home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / basic / qbware.exe / QBWARE.DOC < prev    next >
Text File  |  1990-11-30  |  217KB  |  8,366 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.                                     Q B W A R E  
  24.  
  25.  
  26.  
  27.                          THE QUICKBASIC INTERFACE LIBRARIES 
  28.  
  29.  
  30.  
  31.                                     Version 1.30 
  32.  
  33.  
  34.  
  35.  
  36.  
  37.                           R E F E R E N C E    M A N U A L 
  38.  
  39.  
  40.  
  41.  
  42.            
  43.            
  44.            
  45.            
  46.            
  47.            
  48.            
  49.                                     AJM Software 
  50.                                     P.O. Box 5303 
  51.                                Arvada, Co. 80005-0303 
  52.            
  53.            
  54.  
  55.  
  56.  
  57.  
  58.                         Copyright (c) AJM Software 1987, 1991
  59.                                  All Rights Reserved
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.           Introduction to QBWARE  . . . . . . . . . . . . . . . . . . .   7
  75.  
  76.           A Word about User-supported Software  . . . . . . . . . . . .   8
  77.  
  78.           WARRANTY  . . . . . . . . . . . . . . . . . . . . . . . . . .   9
  79.  
  80.           Registration  . . . . . . . . . . . . . . . . . . . . . . . .  10
  81.                Order Form . . . . . . . . . . . . . . . . . . . . . . .  11
  82.                Corporate and Quantity Purchases   . . . . . . . . . . .  12
  83.  
  84.           LICENSE . . . . . . . . . . . . . . . . . . . . . . . . . . .  13
  85.  
  86.           Product Support . . . . . . . . . . . . . . . . . . . . . . .  14
  87.  
  88.           Using QBWARE  . . . . . . . . . . . . . . . . . . . . . . . .  15
  89.  
  90.           BIOS Video Services . . . . . . . . . . . . . . . . . . . . .  18
  91.                BSVMODE  - Get or set video mode   . . . . . . . . . . .  19
  92.                BSVSCUR  - Set or get cursor size  . . . . . . . . . . .  19
  93.                BSVSWID  - Get screen width  . . . . . . . . . . . . . .  20
  94.                BSVSPOS  - Get or set cursor position  . . . . . . . . .  20
  95.                BSVSPAG  - Get or set video display page   . . . . . . .  21
  96.                BSVSCRUP - Scroll up or clear a window   . . . . . . . .  22
  97.                BSVSCRDN - Scroll down or clear a window   . . . . . . .  22
  98.                BSVRCHR   - Read  a  character and  attribute from  the
  99.                     screen  . . . . . . . . . . . . . . . . . . . . . .  23
  100.                BSVWCHR  - Write a character to the screen   . . . . . .  24
  101.                BSVWTTY  - Write in teletype mode  . . . . . . . . . . .  24
  102.  
  103.           BIOS Keyboard Services  . . . . . . . . . . . . . . . . . . .  25
  104.                BSKGET   - Get a character from the keyboard   . . . . .  26
  105.                BSKSTAT  - Determine the status of the toggle keys   . .  26
  106.                BSKCLR   - Clear the keyboard buffer   . . . . . . . . .  26
  107.                BSKNXT   - Preview the keyboard buffer   . . . . . . . .  27
  108.                BSKSTOG  - Set keyboard toggles  . . . . . . . . . . . .  27
  109.                BSKTOGH  - Determine whether toggle keys are pressed   .  27
  110.                BSCURS   - Set cursor speed  . . . . . . . . . . . . . .  28
  111.  
  112.           BIOS Diskette Services  . . . . . . . . . . . . . . . . . . .  29
  113.                BSDSTAT  - Get diskette controller status  . . . . . . .  30
  114.                BSDRESET - Reset floppy disk controller  . . . . . . . .  31
  115.                BSDVRFY  - Verify sectors on a disk  . . . . . . . . . .  31
  116.                BSDREAD  - Read a sector from a disk   . . . . . . . . .  32
  117.                BSDWRIT  - Write a sector to disk  . . . . . . . . . . .  32
  118.                BSDFMT   - Format a track on a disk  . . . . . . . . . .  33
  119.  
  120.           BIOS Miscellaneous Services   . . . . . . . . . . . . . . . .  35
  121.                BSEQPMT  - Get installed equipment   . . . . . . . . . .  36
  122.                BSPINIT  - Initialize printer  . . . . . . . . . . . . .  36
  123.  
  124.                         Copyright (c) AJM Software 1987, 1991
  125.                                 All Rights Reserved             Page 2
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.                BSPSTAT  - Get printer status  . . . . . . . . . . . . .  37
  140.                BSPRINT  - Print a string of characters  . . . . . . . .  38
  141.  
  142.           BIOS AT Disk Services   . . . . . . . . . . . . . . . . . . .  39
  143.                BSDAPARM - Get current drive parameters  . . . . . . . .  40
  144.                BSDATST  - Test for drive ready  . . . . . . . . . . . .  40
  145.                BSDARST  - Alternate disk reset  . . . . . . . . . . . .  40
  146.                BSDARCL  - Recalibrate drive   . . . . . . . . . . . . .  41
  147.                BSDADIAG - Perform controller diagnostics  . . . . . . .  41
  148.                BSDASTAT - Detect diskette change  . . . . . . . . . . .  41
  149.                BSDATYPE - Get disk type   . . . . . . . . . . . . . . .  42
  150.                BSDASTYP - Set diskette type   . . . . . . . . . . . . .  42
  151.                BSDASEEK - Position heads over a specified cylinder  . .  43
  152.  
  153.           File Attribute Services   . . . . . . . . . . . . . . . . . .  44
  154.                FLGTIM   - Get file creation time  . . . . . . . . . . .  45
  155.                FLGDAT   - Get file creation date  . . . . . . . . . . .  45
  156.                FLGVOL   - Get volume label  . . . . . . . . . . . . . .  46
  157.                FLPDAT   - Change file creation date and time  . . . . .  46
  158.                FLPVOL   - Change volume label   . . . . . . . . . . . .  47
  159.                FLATTR   - Change file attributes  . . . . . . . . . . .  47
  160.  
  161.           File Access Services  . . . . . . . . . . . . . . . . . . . .  50
  162.                FLSET    - Set number of available file handles  . . . .  51
  163.                FLOPEN   - Open a file   . . . . . . . . . . . . . . . .  51
  164.                FLCLOS   - Close a file  . . . . . . . . . . . . . . . .  52
  165.                FLREAD   - Read a record from a file   . . . . . . . . .  52
  166.                FLWRIT   - Write a record to a file  . . . . . . . . . .  53
  167.                FLPOINT  - Point to a specific record in a file  . . . .  54
  168.                FLCREAT  - Create a file   . . . . . . . . . . . . . . .  54
  169.                FLDELETE - Delete a file   . . . . . . . . . . . . . . .  55
  170.                FLRSECT  - Read a sector   . . . . . . . . . . . . . . .  56
  171.                FLWSECT  - Write a sector  . . . . . . . . . . . . . . .  56
  172.  
  173.           DOS Replacement Services  . . . . . . . . . . . . . . . . . .  58
  174.                FLFIND   - Find a file or group of files   . . . . . . .  59
  175.                FLCNT    - Count the number of matching files  . . . . .  59
  176.                FLMOVE   - Move a file   . . . . . . . . . . . . . . . .  60
  177.                FLCOPY   - Copy a file to another file   . . . . . . . .  60
  178.                FLSDRV   - Set the current drive   . . . . . . . . . . .  60
  179.                FLGDRV   - Get the current drive   . . . . . . . . . . .  61
  180.                FLCDIR   - Change the current directory  . . . . . . . .  61
  181.                FLGDIR   - Get the current directory   . . . . . . . . .  62
  182.                FLMDIR   - Make a directory  . . . . . . . . . . . . . .  62
  183.                FLDDIR   - Delete a directory  . . . . . . . . . . . . .  62
  184.                FLDSTAT  - Retrieve disk statistics  . . . . . . . . . .  63
  185.  
  186.           Miscellaneous DOS Services  . . . . . . . . . . . . . . . . .  64
  187.                BOOT    - Initiate a cold or warm boot   . . . . . . . .  65
  188.                DOSEXIT - Terminate with a return code . . . . . . . . .  65
  189.  
  190.                         Copyright (c) AJM Software 1987, 1991
  191.                                 All Rights Reserved             Page 3
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.                DOSEXEC  - SHELL replacement . . . . . . . . . . . . . .  65
  206.                DOSCHOUT - Write a string to the standard output device
  207.                       . . . . . . . . . . . . . . . . . . . . . . . . .  66
  208.                DOSCHRIN -  Read a  character from  the standard  input
  209.                     device  . . . . . . . . . . . . . . . . . . . . . .  66
  210.                DOSSTRIN - Read a string from the standard input device
  211.                       . . . . . . . . . . . . . . . . . . . . . . . . .  67
  212.                DOSRED   - Redirect a DOS standard handle  . . . . . . .  68
  213.                DOSPRSC  - Print the screen  . . . . . . . . . . . . . .  69
  214.                DOSVER   - Get the DOS version   . . . . . . . . . . . .  69
  215.                DOSVRFY  - Turn verify mode on and off   . . . . . . . .  69
  216.  
  217.           The Print Spooler   . . . . . . . . . . . . . . . . . . . . .  71
  218.                DOSPSTAT - Request spooler status  . . . . . . . . . . .  72
  219.                DOSPCAN  - Cancel all spooled files  . . . . . . . . . .  72
  220.                DOSPDEL  - Delete a file from the queue  . . . . . . . .  72
  221.                DOSPLST  - List all files in the queue   . . . . . . . .  73
  222.                DOSPSUB  - Submit a file to the queue  . . . . . . . . .  74
  223.  
  224.           String Functions  . . . . . . . . . . . . . . . . . . . . . .  75
  225.                VERIFY  - Verify all characters in a string  . . . . . .  76
  226.                XVERIFY  - Slightly different twist on VERIFY  . . . . .  76
  227.                CHARXLAT - Replace multiple characters in a string   . .  77
  228.                TRANSLAT - Replace all occurrences  of a character in a
  229.                     string  . . . . . . . . . . . . . . . . . . . . . .  78
  230.                COMPRESS - Remove leading and trailing blanks  . . . . .  78
  231.                UPCASE -  Convert all characters  in a string  to upper
  232.                     case  . . . . . . . . . . . . . . . . . . . . . . .  79
  233.                LOCASE - Convert  all characters in  a string to  lower
  234.                     case  . . . . . . . . . . . . . . . . . . . . . . .  79
  235.                PROPER - Convert a string to a proper name   . . . . . .  79
  236.                HEXSTR - Convert a string to its hexadecimal equivalent
  237.                       . . . . . . . . . . . . . . . . . . . . . . . . .  80
  238.  
  239.           Date/Time Functions   . . . . . . . . . . . . . . . . . . . .  81
  240.                DATEPACK - Pack a date into two bytes  . . . . . . . . .  82
  241.                GREGTJUL  - Convert  a date  from  Gregorian to  Julian
  242.                     format  . . . . . . . . . . . . . . . . . . . . . .  83
  243.                JULTGREG  - Convert  a date  from  Julian to  Gregorian
  244.                     format  . . . . . . . . . . . . . . . . . . . . . .  83
  245.                DAYSDIFF - Compute the number of days between two dates
  246.                       . . . . . . . . . . . . . . . . . . . . . . . . .  83
  247.                WEEKDAY  - Determine the day of the week   . . . . . . .  84
  248.                CALENDAR - Pop-up a calendar anywhere on the screen  . .  84
  249.                ADDTIME  - Add two times together  . . . . . . . . . . .  85
  250.                SUBTIME  - Subtract two times  . . . . . . . . . . . . .  85
  251.                Timer Services . . . . . . . . . . . . . . . . . . . . .  86
  252.                     TIME  . . . . . . . . . . . . . . . . . . . . . . .  86
  253.                     TICKS   . . . . . . . . . . . . . . . . . . . . . .  86
  254.                     BSGETIME  . . . . . . . . . . . . . . . . . . . . .  86
  255.  
  256.                         Copyright (c) AJM Software 1987, 1991
  257.                                 All Rights Reserved             Page 4
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.           Video Primitives  . . . . . . . . . . . . . . . . . . . . . .  88
  272.                PUTLINE  - Write a line of text to the video buffer  . .  89
  273.                SAVESCR   -  Copy a  window  from the  video buffer  to
  274.                     memory  . . . . . . . . . . . . . . . . . . . . . .  89
  275.                RESTSCR   - Restore a  window from memory to  the video
  276.                     buffer  . . . . . . . . . . . . . . . . . . . . . .  90
  277.                INPWIN   - Get input from the keyboard   . . . . . . . .  91
  278.                COLORLIN - Change the color of a window  . . . . . . . .  91
  279.  
  280.           Window Routines   . . . . . . . . . . . . . . . . . . . . . .  93
  281.                PUTWIND  - Pop up a window on the screen   . . . . . . .  94
  282.                PUSHWIN  - Copy a  window from the video buffer  to the
  283.                     screen stack  . . . . . . . . . . . . . . . . . . .  94
  284.                POPWIN   -  Copy a window from the window  stack to the
  285.                     video buffer  . . . . . . . . . . . . . . . . . . .  94
  286.                INITWIN       -   Initialize    windowing   environment
  287.                     parameters  . . . . . . . . . . . . . . . . . . . .  95
  288.                DEFWIN   - Define individual window parameters   . . . .  96
  289.                CNGWIN   - Change window parameters  . . . . . . . . . .  97
  290.                MOVEWIN  -  Move a window  to a  different part of  the
  291.                     screen  . . . . . . . . . . . . . . . . . . . . . .  98
  292.                POPTEXT  - Display an array of text within a window  . .  98
  293.                POPFTEXT - Display a formatted text window   . . . . . .  99
  294.                COLORWIN - Recolor a window  . . . . . . . . . . . . . . 100
  295.  
  296.           Input Routines  . . . . . . . . . . . . . . . . . . . . . . . 101
  297.                INCHAR   - Accept input of a string of characters  . . . 102
  298.                INDATE   - Accept date input   . . . . . . . . . . . . . 103
  299.                INYES    - Accept yes/no input   . . . . . . . . . . . . 104
  300.                INMF     - Accept male/female input  . . . . . . . . . . 105
  301.  
  302.           Menu Routines   . . . . . . . . . . . . . . . . . . . . . . . 107
  303.                BARMENU  - Provide a two line bar menu   . . . . . . . . 108
  304.                BARMENU1 - Multi-line bar menu   . . . . . . . . . . . . 108
  305.                BARMENU2 - Lotus-like bar menu   . . . . . . . . . . . . 109
  306.                PULLDOWN - Display a pulldown menu   . . . . . . . . . . 110
  307.                SCRLSLCT  -  Display  a scrollable  list  of  items for
  308.                     selection   . . . . . . . . . . . . . . . . . . . . 110
  309.  
  310.           Miscellaneous Routines  . . . . . . . . . . . . . . . . . . . 112
  311.                PESORT - Sort a character array  . . . . . . . . . . . . 113
  312.                FNMODULO - Find the modulus of a large number  . . . . . 113
  313.                QBCHIP    - Determine Processor and Co-Processor type  . 113
  314.  
  315.           Appendices  . . . . . . . . . . . . . . . . . . . . . . . . . 115
  316.                Appendix A   . . . . . . . . . . . . . . . . . . . . . . 115
  317.                     Keyboard Scan Codes   . . . . . . . . . . . . . . . 115
  318.                Appendix B   . . . . . . . . . . . . . . . . . . . . . . 116
  319.                     BASIC Colors  . . . . . . . . . . . . . . . . . . . 116
  320.                Appendix C   . . . . . . . . . . . . . . . . . . . . . . 117
  321.  
  322.                         Copyright (c) AJM Software 1987, 1991
  323.                                 All Rights Reserved             Page 5
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.                     About Disks and Diskettes   . . . . . . . . . . . . 117
  338.                APPENDIX D   . . . . . . . . . . . . . . . . . . . . . . 122
  339.                     Using the File Access Services  . . . . . . . . . . 122
  340.                Appendix E   . . . . . . . . . . . . . . . . . . . . . . 123
  341.                     The Print Spooler   . . . . . . . . . . . . . . . . 123
  342.                Appendix F . . . . . . . . . . . . . . . . . . . . . . . 125
  343.                     QBWARE Windowing Routines   . . . . . . . . . . . . 125
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.                         Copyright (c) AJM Software 1987, 1991
  389.                                 All Rights Reserved             Page 6
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.                                Introduction to QBWARE 
  404.            
  405.            
  406.           QBWARE is a  comprehensive set of callable routines  that provide
  407.           easy to  use extensions to  QuickBasic.  The DOS  subroutines are
  408.           specifically designed to provide an easy to use interface between
  409.           Quickbasic  programs  and  certain  DOS   facilities  that  would
  410.           normally be  unavailable to a Quickbasic program.   These include
  411.           access to the DOS  print spooler and memory management  routines.
  412.           It is very important to read the manual before using any of these
  413.           services, as proper setup is important. 
  414.            
  415.           The BIOS subroutines are specifically designed to provide an easy
  416.           to  use interface between Quickbasic programs and your computer's
  417.           Basic  Input/Output  System  (BIOS).     The  system  BIOS  is  a
  418.           collection  of  programs  that control  most  of  the fundamental
  419.           processes or functions of your computer such as system startup or
  420.           initialization, communications  with peripheral  devices such  as
  421.           video, disks, modems,  printers, etc., handling of  certain error
  422.           conditions such as Ctrl-Break, Divide by  zero, and others.  Some
  423.           of the services presented here are already provided in Quickbasic
  424.           and many  of them are not.  They  will provide you with a greater
  425.           degree  of control  over the  environment in  which  your program
  426.           executes as well as performing these services much more quickly. 
  427.            
  428.           The  file management  subroutines  are  specifically designed  to
  429.           provide an  easy to use interface between Quickbasic programs and
  430.           the DOS File  Management services.  DOS  File Management services
  431.           are a  layer of  software that sit  between your program  and the
  432.           computer's diskette or hard drive. 
  433.            
  434.           You  must keep in mind that  many of these routines interact with
  435.           your computer's BIOS and have been designed and tested on IBM and
  436.           COMPAQ computers.   In order for them to  function properly, your
  437.           computer must be an IBM or Compatible.  These functions have been
  438.           tested with version 4 and version 4.5 of Quickbasic. 
  439.            
  440.            
  441.            
  442.            
  443.            
  444.            
  445.            
  446.            
  447.             
  448.            
  449.            
  450.            
  451.            
  452.                 Quickbasic is a registered trademark of Microsoft. 
  453.  
  454.                         Copyright (c) AJM Software 1987, 1991
  455.                                 All Rights Reserved             Page 7
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.             
  470.                         A Word about User-supported Software 
  471.            
  472.           User-supported software is a means for the computing community to
  473.           receive  quality  software  while  directly  supporting  software
  474.           authors.  It is based on the ideas that: 
  475.            
  476.                The value  and utility of  software is best assessed  by the
  477.                user on his or her own  system.  Only after using a  program
  478.                can  one   really  determine  whether  it   serves  personal
  479.                applications, needs and tastes.  
  480.  
  481.                The creation of  independent personal computer  software can
  482.                and should be supported by the computing community.  
  483.  
  484.                Copying  of  programs  should  be  encouraged,  rather  than
  485.                restricted.  The ease with which software can be distributed
  486.                outside   traditional  commercial   channels  reflects   the
  487.                strength,   rather   than   the  weakness,   of   electronic
  488.                information. 
  489.            
  490.           Under the user supported concept, anyone may request a copy of  a
  491.           user-supported program by  sending a blank, formatted disk to the
  492.           program author  together with  an addressed,  postage-paid return
  493.           mailer.  A copy of the program, along with documentation on disk,
  494.           will be sent by return mail on the user's disk. 
  495.            
  496.           The  program carries  a notice  suggesting  registration for  the
  497.           program. You should  register if you are going to use the program
  498.           on a regular  basis.  Regardless of whether you  register and use
  499.           the  program,  you are  encouraged  to  copy  and distribute  the
  500.           program for the private, non-commercial, trial use of others. 
  501.            
  502.           User  supported software is generally not public domain material;
  503.           most programs of  this nature carry a copyright  notice.  Rather,
  504.           the author  has licensed you  to copy  and use the  program under
  505.           certain conditions.   Likewise,  user supported  software is  not
  506.           intended to be  free software; it is an  experiment in economics,
  507.           not  altruism.  It is  intended to provide  quality software at a
  508.           low  price, while  directly supporting  the  author, without  the
  509.           overhead of distributors,  dealers and advertising  that produces
  510.           $500 software packages. 
  511.  
  512.           User  supported software is  having a hard  time.  More  and more
  513.           packages are  being taken out of this market, and offered as more
  514.           traditional, and  expensive, products.   The  reason for  this is
  515.           simple: lots  of people are using  the packages but very  few are
  516.           paying for them.   And without the support of the users, there is
  517.           absolutely no  incentive for  software authors  to provide  their
  518.           programs in this fashion. 
  519.  
  520.                         Copyright (c) AJM Software 1987, 1991
  521.                                 All Rights Reserved             Page 8
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.           There are many good reasons  to register.  Besides supporting the
  536.           author (that is, paying for  the software you use), you generally
  537.           get better support and receive mailed notification of updates and
  538.           other  products.   In conclusion,  if  you regularly  use a  user
  539.           supported program  (sometimes called  Freeware or  Shareware) and
  540.           have not sent  in a registration to the author, please do so now.
  541.           Only through  the financial  support of users  will this  kind of
  542.           inexpensive software continue to be available. 
  543.  
  544.                                       WARRANTY 
  545.            
  546.            
  547.           AJM Software makes  no warranty of any kind,  express or implied,
  548.           including without limitation,  any warranties of  merchantability
  549.           and/or fitness for a particular  purpose.  AJM Software shall not
  550.           be liable for any damages,  whether direct, indirect, special  or
  551.           consequential arising  from a failure of this  program to operate
  552.           in the  manner desired by  the user.   AJM Software shall  not be
  553.           liable for  any damage to  data or  property which may  be caused
  554.           directly or indirectly by use of the program. 
  555.            
  556.           IN NO  EVENT WILL AJM Software BE LIABLE  TO YOU FOR ANY DAMAGES,
  557.           INCLUDING  ANY LOST PROFITS, LOST  SAVINGS OR OTHER INCIDENTAL OR
  558.           CONSEQUENTIAL DAMAGES ARISING OUT OF YOUR USE OR INABILITY TO USE
  559.           THE PROGRAM, OR FOR ANY CLAIM BY ANY OTHER PARTY.
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.                         Copyright (c) AJM Software 1987, 1991
  587.                                 All Rights Reserved             Page 9
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.                         Registration and ordering information 
  602.            
  603.            
  604.           A  QBWARE registration  licenses  you  to use  the  product on  a
  605.           regular  basis.   Registration  includes  mailed notification  of
  606.           updates  and priority  support.  Users  need  register  only  one
  607.           version  of QBWARE -  registration includes  licensed use  of all
  608.           upgrades. 
  609.            
  610.           Individual  registrations  for  QBWARE  are  available  from  AJM
  611.           Software at a cost of $39.00.  AJM will provide you with the most
  612.           current release of QBWARE in both object and assembly source code
  613.           form on 5  1/4 inch diskette or  3 1/2" diskette.   The reference
  614.           manual will also be included on the diskette. 
  615.            
  616.           Registration entitles you to include  any QBWARE routine in  your
  617.           applications for distribution without  royalty.  Including QBWARE
  618.           in your applications without registration is strictly prohibited.
  619.  
  620.  
  621.           Quantity discounts are available.  Please see the  section titled
  622.           'Corporate and quantity purchases'. 
  623.            
  624.           In addition, evaluation disks are  available at any time for $10.
  625.           These  disks  do  not  include  registration.    The  fee  covers
  626.           diskette, postage and handling. 
  627.            
  628.           Please use the enclosed order form when placing an order. 
  629.            
  630.           ORDERS OUTSIDE  THE US: Please  include an  additional $10.00  to
  631.           cover additional postage and handling costs.  No C.O.D.'s will be
  632.           accepted on orders delivered outside the US. 
  633.            
  634.            
  635.            
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.                         Copyright (c) AJM Software 1987, 1991
  653.                                 All Rights Reserved             Page 10
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.     Remit to:                     AJM Software                     Order Form 
  669.                                   P.O. Box 5303 
  670.                               Arvada, CO 80005-0303 
  671.  
  672.     Please send: 
  673.  
  674.     ____ QBWARE Disk (Evaluation only) ............. @ $ 10.00 ea  $ ______ 
  675.          (includes all routines in .QLB form and manual on disk) 
  676.  
  677.     ____ QBWARE Registration ....................... @ $ 39.00 ea  $ ______ 
  678.          (includes QBWARE disk and source code) 
  679.                                                          Subtotal    ______ 
  680.  
  681.       Please check appropriate version              Less Discount   <______> 
  682.  
  683.       QB V4     ____                           C.O.D. Fee ($5.00)    ______ 
  684.  
  685.       QB V4.5   ____                          3 1/2" Disk ($5.00)    ______ 
  686.  
  687.                      Shipping and Handling (Outside of U.S. only)    ______
  688.  
  689.                                                              Total $ ______ 
  690.  
  691.     Payment by:   ( ) Check   ( ) C.O.D. [NO CREDIT CARDS]
  692.  
  693.        Name: ____________________________________________________________ 
  694.  
  695.     Company: ____________________________________________________________ 
  696.  
  697.     Address: ____________________________________________________________ 
  698.  
  699.            : ____________________________________________________________ 
  700.  
  701.            : ____________________________________________________________ 
  702.  
  703.     Day Phone: _________________________ Eve: ___________________________ 
  704.  
  705.  
  706.  
  707.     ORDERS OUTSIDE THE US: Please include an additional $10.00 to cover 
  708.     additional postage and handling costs.  No C.O.D.'s will be accepted 
  709.     on orders delivered outside the US. 
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.                         Copyright (c) AJM Software 1987, 1991
  719.                                 All Rights Reserved             Page 11
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.                           Corporate and Quantity Purchases 
  734.            
  735.            
  736.           All  corporate, business, government or other commercial users of
  737.           QBWARE must be  registered.  We offer quantity discounts starting
  738.           at the sixth copy. 
  739.            
  740.           Orders in  quantities of less than  50 units are handled  as bulk
  741.           purchases. Purchases of over 50  units may be handled as quantity
  742.           purchases  or  as  corporate  licensing  agreements.    Licensing
  743.           agreements allow duplication and distribution of specific numbers
  744.           of  copies within  the  licensed  institution.    Duplication  of
  745.           multiple  copies is  not allowed  except  through execution  of a
  746.           licensing agreement.  Please write for details. 
  747.            
  748.           The quantity purchase discounts are as follows: 
  749.  
  750.                0- 5  copies:      no discount 
  751.                6- 20 copies:      20% discount 
  752.                21+   copies:      40% discount 
  753.  
  754.           ALL  PRICES AND DISCOUNTS  ARE SUBJECT TO  CHANGE WITHOUT NOTICE.
  755.           Discounts are not cumulative; they apply to single orders of like
  756.           products only. Unit prices are the same as for individual users. 
  757.            
  758.           WARNING: YOU MAY NOT USE QBWARE WITHIN YOUR ORGANIZATION  WITHOUT
  759.           A PRIOR PURCHASE OR LICENSE ARRANGEMENT. 
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.                         Copyright (c) AJM Software 1987, 1991
  785.                                 All Rights Reserved             Page 12
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.                                        LICENSE 
  800.            
  801.           All versions  of QBWARE, including  version 1.0,  are not  public
  802.           domain software, nor are they free software. 
  803.            
  804.           QBWARE is copyright (C) 1987, 1991 by AJM Software 
  805.            
  806.           Non-registered users are granted a limited license to use  QBWARE
  807.           on a trial  basis for the  purpose of  determining whether it  is
  808.           suitable for their needs.  Use of QBWARE, except for this limited
  809.           purpose,  requires registration.  Use of non-registered copies of
  810.           QBWARE by any person,  business, corporation, governmental agency
  811.           or other entity institution is strictly forbidden. 
  812.            
  813.           Registration  permits  a  user  the license  to  use  QBWARE  for
  814.           development purposes, only  on a single computer.   QBWARE can be
  815.           included into any  program and distributed  in library form  only
  816.           without  royalty. A  registered user  may  use the  program on  a
  817.           different computer, but may not use  the program on more than one
  818.           computer at the same time. 
  819.  
  820.           All users are  granted a limited license to  copy QBWARE only for
  821.           the trial  use of  others subject to  the above  limitations, and
  822.           also the following: 
  823.            
  824.                QBWARE must be copied in unmodified form, complete with  the
  825.                file containing this license information. 
  826.            
  827.                The  full QBWARE  documentation must  be  included with  the
  828.                copy. 
  829.            
  830.                No  fee, charge  or other  compensation may  be  accepted or
  831.                requested  by any  licensee, except  a handling  fee not  to
  832.                exceed $10.00.
  833.            
  834.                QBWARE may  not be distributed in conjunction with any other
  835.                product. 
  836.            
  837.                The  ASSEMBLY source code for QBWARE  may NOT be distributed
  838.                under any circumstances. 
  839.  
  840.                The object modules supplied with a registered copy of QBWARE
  841.                may NOT be distributed under any circumstances. 
  842.            
  843.                Operators of electronic bulletin  board systems (Sysops) may
  844.                post QBWARE for  downloading by their users only  as long as
  845.                the above conditions are met. 
  846.            
  847.                Distributors of public  domain or  user supported  software,
  848.                other than operators of  electronic bulletin board  systems,
  849.  
  850.                         Copyright (c) AJM Software 1987, 1991
  851.                                 All Rights Reserved             Page 13
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.                may  distribute  copies  of  QBWARE  subject  to  the  above
  866.                conditions only after obtaining written permission  from AJM
  867.                Software. 
  868.                                    Product Support 
  869.            
  870.           If  you have any questions  or comments about  the use of QBWARE,
  871.           please fill out a problem log and send it to us. 
  872.            
  873.           In your note, describe as  completely as possible the problem you
  874.           are  having.   Let  us  know  your machine  configuration,  which
  875.           routine  you  are questioning,  the  version of  QBWARE,  and any
  876.           resident software  installed.  If  possible, include  a copy  (on
  877.           paper) of your source code. 
  878.            
  879.           Describe  what steps  you  take before  the  problem occurs,  and
  880.           exactly what  the program  does when it  occurs.   If you  do not
  881.           provide us  with a complete  description of the problem  there is
  882.           little we can do to help. We'll  do our best to get you past  the
  883.           problem, but if you are not a registered user we do not guarantee
  884.           to provide support of any kind. 
  885.            
  886.           Please be patient.  We usually respond to registered users within
  887.           3 working days at the most. 
  888.            
  889.           We   will  provide  support   to  non-registered  users   at  our
  890.           discretion.   It generally depends  on how the request  is worded
  891.           and the mental disposition of the staff person assigned to handle
  892.           requests on that day. 
  893.            
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.                         Copyright (c) AJM Software 1987, 1991
  917.                                 All Rights Reserved             Page 14
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.            
  932.                                     Using QBWARE 
  933.                               QuickBasic versions 4, 4.5
  934.            
  935.           All of  the QBWARE  routines can be  accessed via  the Quickbasic
  936.           'Call' statement.  The format of this statement is as follows: 
  937.            
  938.                Call Function(Parm1%, Parm2%, Parm3$) 
  939.            
  940.           Function is the name of the routine  to be executed.  It must  be
  941.           spelled  exactly  as  shown  in  the  following  chapters.    The
  942.           parameters to  be passed to the routine will also be explained in
  943.           the  following  chapters.   You  must  use  the exact  number  of
  944.           parameters  shown in each function description and each parameter
  945.           must  be the  type  (i.e.  character or  integer)  shown in  each
  946.           function description.  Using an incorrect number of parameters or
  947.           using a parameter of the wrong type (i.e. using character instead
  948.           of integer)  will generally result in the abnormal termination of
  949.           your  program.   Usually  you  will get  either  a 'String  Space
  950.           Corrupt' error or you  will start executing the  wrong statements
  951.           in  your program.    In any  event,  it is  almost impossible  to
  952.           predict the  results  of these  two  types of  errors,  so it  is
  953.           critical that you be very careful in coding the call statements. 
  954.            
  955.           The parameters passed to QBWARE routines will be either character
  956.           or  numeric  integers.   There  are no  special  requirements for
  957.           passing integers and  constants may also  be used.   There is  no
  958.           functional difference between these two sets of statements: 
  959.            
  960.                Example 1 
  961.            
  962.                     Drive$ = "A"                      'Indicate drive a 
  963.                     Vol$ = "DISK LABEL "              'New volume label 
  964.                     Call FlPVol(Drive$, Vol$, Rc%)    'Call QBWARE routine 
  965.            
  966.                Example 2 
  967.            
  968.                     Call FlPVol("A", "DISK LABEL ", Rc%) 
  969.            
  970.           Note that  Rc% must  not be  defined as  a  constant because  the
  971.           QBWARE  routine  will return  a  value  in  this field  and  your
  972.           Quickbasic program cannot access this field if it is defined as a
  973.           constant.  All character fields must be initialized to the proper
  974.           length before calling a  QBWARE function.   Failing to do so  may
  975.           result in a 'String Space  Corrupt' condition.  The following two
  976.           examples appear  similar but  Example 1 will  fail and  Example 2
  977.           will succeed because 'Char$' has been properly initialized. 
  978.            
  979.                Example 1 (incorrect) 
  980.            
  981.  
  982.                         Copyright (c) AJM Software 1987, 1991
  983.                                 All Rights Reserved             Page 15
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.                     Char$ = ""                        'clear work field 
  998.                     Call  FlGDrv(Char$)                    'get the current
  999.                     drive 
  1000.  
  1001.            
  1002.                Example 2 (correct) 
  1003.            
  1004.                     Char$ = space$(1)                 'clear work field 
  1005.                     Call FlGDrv(Char$,)                   'get  the current
  1006.                     drive 
  1007.  
  1008.           Many  of the  Assembly  Language routines  require  arrays to  be
  1009.           passed to  them.    The  only  way to  pass  arrays  and  achieve
  1010.           consistent results is  via the VARPTR function. Using VARPTR will
  1011.           ensure  consistent results when  using QBWARE routines  from both
  1012.           the development environment and the  DOS command line (NOTE  that
  1013.           this applies  only to  the  QBWARE Assembly  language routines  -
  1014.           QBWARE routines  written in Quickbasic do not require that arrays
  1015.           be passed in this manner). 
  1016.            
  1017.           For Example:
  1018.  
  1019.                Call FlFind(Count%, VARPTR(DirList$(LBound(DirList$)))) 
  1020.             
  1021.           Using VARPTR will  insure compatibility in compiling  from within
  1022.           the QB4 environment and from the DOS prompt. 
  1023.            
  1024.  
  1025.           You can  use QBWARE  routines within  the Quickbasic  development
  1026.           environment.  This is done by starting QuickBasic as follows: 
  1027.            
  1028.                QB /L QBWARE 
  1029.  
  1030.           Make sure that  the file QBWARE.QLB is in  the current directory.
  1031.           This automatically loads  the QBWARE quick  library into the  QB4
  1032.           environment. 
  1033.  
  1034.           Sample  batch  files  are  provided  on  the  distribution  disks
  1035.           (registered users only) to compile your Quickbasic programs.
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.                         Copyright (c) AJM Software 1987, 1991
  1049.                                 All Rights Reserved             Page 16
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.                                   PRECAUTIONS!!!!!! 
  1064.            
  1065.            
  1066.           These routines  were designed to  used with Quickbasic on  an IBM
  1067.           PC or  compatible computer.   Using this  product with  any Basic
  1068.           compiler or  interpreter other than  Quickbasic version 4  or 4.5
  1069.           will probably not work and may cause loss of data. 
  1070.            
  1071.           Using this product on a non-IBM compatible computer will give hit
  1072.           or miss results.  Some things will work, some  things won't work.
  1073.           The only way to find out is to try. 
  1074.  
  1075.  
  1076.           A SPECIAL  NOTE ABOUT HARD  DISKS - there are  many manufacturers
  1077.           and  varieties  of  hard  disks  available for  the  IBM  PC  and
  1078.           compatible computer.   Many of these hard disks  work through the
  1079.           traditional BIOS functions and many provide their own proprietary
  1080.           software  to function  properly.   These  disks with  proprietary
  1081.           software may not  respond properly to some of  the BIOS interface
  1082.           routines.  IN ANY EVENT, DO NOT TEST ANY HARD DISK OR FLOPPY DISK
  1083.           ROUTINES WITHOUT  FIRST BACKING UP  YOUR DISK -  REPEAT -  DO NOT
  1084.           TEST ANY HARD DISK OR  FLOPPY DISK ROUTINES WITHOUT FIRST BACKING
  1085.           UP YOUR DISK. 
  1086.            
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.                         Copyright (c) AJM Software 1987, 1991
  1115.                                 All Rights Reserved             Page 17
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.            
  1130.                                The BIOS Video Services 
  1131.            
  1132.            
  1133.                Function Summary 
  1134.            
  1135.            
  1136.                     BSVMODE  - Get or set video mode 
  1137.            
  1138.                     BSVSCUR  - Set or get cursor size 
  1139.            
  1140.                     BSVSWID  - Get screen width 
  1141.            
  1142.                     BSVSPOS  - Get or set cursor position 
  1143.  
  1144.                     BSVSPAG  - Get or set video display page 
  1145.  
  1146.                     BSVSCRUP - Scroll up or clear a window 
  1147.  
  1148.                     BSVSCRDN - Scroll down or clear a window 
  1149.            
  1150.                     BSVRCHR  - Read a character and attribute from the     
  1151.                                          screen 
  1152.            
  1153.                     BSVWCHR  - Write a character to the screen 
  1154.            
  1155.                     BSVWTTY  - Write in teletype mode 
  1156.  
  1157.  
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.                         Copyright (c) AJM Software 1987, 1991
  1181.                                 All Rights Reserved             Page 18
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.       BSVMODE  - Get or set video mode 
  1196.  
  1197.       Usage - Call BsVMode(Function%, Mode%) 
  1198.  
  1199.  
  1200.          Function%    0 - set video mode 
  1201.                       1 - get video mode 
  1202.  
  1203.          Mode%   (When Function% = 0, Mode% must be initialized to one 
  1204.                   of the following values.  When Function% = 1, Mode% will 
  1205.                   return one of the following values.) 
  1206.  
  1207.               Mode  Type                                   Adapter 
  1208.  
  1209.               0     40 X 25 B/W text                       CGA 
  1210.               1     40 X 25 16 color text                  CGA 
  1211.               2     80 X 25 B/W text                       CGA 
  1212.               3     80 X 25 16 color text                  CGA 
  1213.               4     320 X 200 4 color graphics             CGA 
  1214.               5     320 X 200 4-Grey graphics              CGA 
  1215.               6     640 X 200 B/W graphics                 CGA 
  1216.               7     80 X 25 B/W text                       MA(Monochrome) 
  1217.               8     160 X 200 16 color graphics            PCjr 
  1218.               9     320 X 200 16 color graphics            PCjr 
  1219.               10    640 X 200 4 color graphics             PCjr 
  1220.               10    640 X 200 16 color graphics            EGA 
  1221.               13    320 X 200 4 color graphics             EGA 
  1222.               14    640 X 200 16 color graphics            EGA 
  1223.               15    640 X 350 4 color graphics             EGA 
  1224.               16    640 X 350 4 or 16 color graphics       EGA 
  1225.  
  1226.       Programming notes: 
  1227.  
  1228.       For RGB monitors, there is no functional difference between modes 0 and 1, 
  1229.       or between modes 2 and 3. 
  1230.  
  1231.       The EGA will support all modes except 8 and 9. 
  1232.  
  1233.       Normally, the screen buffer will be cleared when you set the video mode - 
  1234.       even if you set it the same mode.  This is not, however, a recommended 
  1235.       method for clearing the screen as it could cause some delay in many PC- 
  1236.       compatibles. 
  1237.  
  1238.       Using a mode that is not supported by your video adapter card will have 
  1239.       unpredictable results. 
  1240.   
  1241.       BSVSCUR  - Set or get cursor size
  1242.  
  1243.       Usage - Call BsVSCur(Function%, Start%, End%) 
  1244.  
  1245.  
  1246.                         Copyright (c) AJM Software 1987, 1991
  1247.                                 All Rights Reserved             Page 19
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.          Function%    0 - set cursor size 
  1262.                       1 - get cursor size 
  1263.  
  1264.          Start%       Starting scan line 
  1265.  
  1266.          End%         Ending scan line 
  1267.  
  1268.       Programming notes: 
  1269.  
  1270.       The scan line is a row of pixels that make up a character on the screen. 
  1271.       On monochrome monitors, there are 13 scan lines numbered 0 thru 12.  On 
  1272.       RGB monitors, there are 8 scan lines numbered 0 thru 7.  The default val 
  1273.       ues for cursor size are as follows: 
  1274.  
  1275.       Mode    Display                     Start       End 
  1276.  
  1277.       0-3     RGB Monitor (text modes)      6          7 
  1278.       7       Monochrome                    11         12 
  1279.  
  1280.       The hardware causes the cursor to blink and it normally cannot be dis 
  1281.       abled while in text mode, however, some machines will cause the cursor to 
  1282.       disappear when a starting scan line of 32 is used.  A technique that 
  1283.       always makes the cursor disappear is to move it off the screen using 
  1284.       BSVSPOS (e.g. move it to column 1, row 26). 
  1285.  
  1286.       Using a starting scan line that is greater than the ending scan line will 
  1287.       make the cursor wrap and cause a two-part cursor to show on the screen. 
  1288.  
  1289.       Function% must be initialized prior to calling BSVSCUR.  If function% is 0 
  1290.       then Start% and End% must be initialized to proper values prior to making 
  1291.       the call. 
  1292.  
  1293.  
  1294.       BSVSWID  - Get screen width 
  1295.  
  1296.       Usage - Call BsVSWid(Wid%) 
  1297.  
  1298.          Wid%         Number of characters that can be displayed on the screen - 
  1299.                       either 40 or 80. 
  1300.  
  1301.  
  1302.       BSVSPOS  - Get or set cursor position 
  1303.  
  1304.       Usage - Call BsVSPos(Function%, Row%, Column%, Page%) 
  1305.  
  1306.          Function%    0 - set cursor position 
  1307.                       1 - get cursor position 
  1308.  
  1309.          Row%         Cursor coordinate 
  1310.  
  1311.  
  1312.                         Copyright (c) AJM Software 1987, 1991
  1313.                                 All Rights Reserved             Page 20
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.          Column%      Cursor coordinate 
  1328.  
  1329.          Page%        Display page whose cursor position is to be set or 
  1330.                       retrieved. 
  1331.  
  1332.       Programming notes: 
  1333.  
  1334.       A separate cursor is maintained for each display page (See BSVSPAG for 
  1335.       more on display pages).  The cursor is affected only in the display page 
  1336.       specified. 
  1337.  
  1338.       Coordinates (1,1) represent the upper left hand corner of the screen. 
  1339.  
  1340.       Coordinates (80,25) represent the lower right-hand corner of the screen. 
  1341.  
  1342.       Positioning the cursor outside the limits of the current display will 
  1343.       cause the cursor to disappear. 
  1344.  
  1345.       In graphics modes, Row% and Column% should be interpreted as pixel coordi 
  1346.       nates. 
  1347.  
  1348.       Function% and Page% must be initialized prior to calling BSVSPOS.  If 
  1349.       Function% is 0 then Row% and Column% must be initialized prior to making 
  1350.       the call. 
  1351.  
  1352.  
  1353.       BSVSPAG  - Get or set video display page 
  1354.  
  1355.       Usage - Call(BsVSPag(Function%, Page%) 
  1356.  
  1357.          Function%    0 - set current page 
  1358.                       1 - get current page 
  1359.  
  1360.       Programming Notes: 
  1361.  
  1362.       Valid page ranges are as follows: 
  1363.  
  1364.       Page range               Mode                 Adapter 
  1365.  
  1366.        0 - 7                   0                    CGA 
  1367.        0 - 7                   1                    CGA 
  1368.        0 - 3                   2                    CGA 
  1369.        0 - 3                   3                    CGA 
  1370.        0 - 7                   2                    EGA 
  1371.        0 - 7                   3                    EGA 
  1372.        0 - 7                   13                   EGA 
  1373.        0 - 3                   14                   EGA 
  1374.        0 - 1                   15                   EGA 
  1375.        0 - 1                   16                   EGA 
  1376.  
  1377.  
  1378.                         Copyright (c) AJM Software 1987, 1991
  1379.                                 All Rights Reserved             Page 21
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.       Changing pages has no effect on their contents and text can be written to 
  1395.       any page regardless of which page is active. 
  1396.  
  1397.       Using multiple pages is not possible on a monochrome monitor with an MDA 
  1398.       adapter. 
  1399.  
  1400.       Function% must be initialized to 0 or 1 prior to calling BSVSPAG.  If 
  1401.       Function% is 0 then Page% must be initialized to a valid page number. 
  1402.  
  1403.  
  1404.  
  1405.       BSVSCRUP - Scroll up or clear a window 
  1406.  
  1407.       Usage - Call BsVScrup(Lines%, FgColor%, BgColor%, Ulc%, Ulr%, Lrc%, Lrr%) 
  1408.  
  1409.          Lines%       Number of lines to scroll up.  If Lines% is zero, then the 
  1410.                       entire window is blanked. 
  1411.  
  1412.          FgColor%     Foreground color - 0 thru 31 are valid foreground colors. 
  1413.  
  1414.          BgColor%     Background color - 0 thru 7 are valid background colors. 
  1415.  
  1416.          Ulc%         Coordinate of the left column of the scroll window. 
  1417.                       1 indicates the far left column. 
  1418.  
  1419.          Ulr%         Coordinate of the top row of the scroll window.  1 indi 
  1420.                       cates the top row of the screen. 
  1421.  
  1422.          Lrc%         Coordinate of the right column of the scroll window.  80 
  1423.                       is the far right column. 
  1424.  
  1425.          Lrr%         Coordinate of the bottom row of the scroll window.  25 is 
  1426.                       the last row of the screen. 
  1427.  
  1428.       Programming notes: 
  1429.  
  1430.       This function affects only the currently active display page and any data 
  1431.       scrolled off of the window is lost.  Blank lines are inserted at the bot 
  1432.       tom of the window.  If the number of lines to scroll equals zero, then the 
  1433.       entire window is blanked out. 
  1434.  
  1435.       All fields must be initialized prior to calling BSVSCRUP. 
  1436.  
  1437.  
  1438.       BSVSCRDN - Scroll down or clear a window 
  1439.  
  1440.       Usage - Call BsVScrdn(Lines%, FgColor%, BgColor%, Ulc%, Ulr%, Lrc%, Lrr%) 
  1441.  
  1442.          Lines%       Number of lines to scroll down.  If Lines% is zero, then 
  1443.  
  1444.                         Copyright (c) AJM Software 1987, 1991
  1445.                                 All Rights Reserved             Page 22
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.                       the entire window is blanked. 
  1460.  
  1461.          FgColor%     Foreground color - 0 thru 31 are valid foreground colors. 
  1462.  
  1463.          BgColor%     Background color - 0 thru 7 are valid background colors. 
  1464.  
  1465.          Ulc%         Coordinate of the left column of the scroll window. 
  1466.                       1 indicates the far left column. 
  1467.  
  1468.          Ulr%         Coordinate of the top row of the scroll window.  1 indi 
  1469.                       cates the top row of the screen. 
  1470.  
  1471.          Lrc%         Coordinate of the right column of the scroll window.  80 
  1472.                       is the far right column. 
  1473.  
  1474.          Lrr%         Coordinate of the bottom row of the scroll window.  25 is 
  1475.                       the last row of the screen. 
  1476.  
  1477.       Programming notes: 
  1478.  
  1479.       This function affects only the currently active display page and any data 
  1480.       scrolled off of the window is lost.  Blank lines are inserted at the top 
  1481.       of the window.  If the number of lines to scroll equals zero, then the 
  1482.       entire window is blanked out. 
  1483.  
  1484.       All fields must be initialized prior to calling BSVSCRDN. 
  1485.  
  1486.  
  1487.       BSVRCHR  - Read a character and attribute from the screen 
  1488.  
  1489.       Usage - Call BsVRChr(Char$, FgColor%, BgColor%, Row%, Col%, Page%) 
  1490.  
  1491.          Char$        Character read from the screen. 
  1492.  
  1493.          FgColor%     Foreground color 
  1494.  
  1495.          BgColor%     Background color 
  1496.  
  1497.          Row%         Coordinate of the character to read from the screen. 
  1498.  
  1499.          Col%         Coordinate of the character to read from the screen. 
  1500.  
  1501.          Page%        Display page to read 
  1502.  
  1503.  
  1504.  
  1505.       Programming notes: 
  1506.  
  1507.       Char$ should be initialized to a single space prior to using this service. 
  1508.  
  1509.  
  1510.                         Copyright (c) AJM Software 1987, 1991
  1511.                                 All Rights Reserved             Page 23
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.   
  1526.       BSVWCHR  - Write a character to the screen 
  1527.  
  1528.       Usage - Call BsVWChr(Char$, FgColor%, BgColor%, Row%, Col%, Page%) 
  1529.  
  1530.          Char$        Character to write to the screen. 
  1531.  
  1532.          FgColor%     Foreground color 
  1533.  
  1534.          BgColor%     Background color 
  1535.  
  1536.          Row%         Coordinate of the character to write to the screen. 
  1537.  
  1538.          Col%         Coordinate of the character to write to the screen. 
  1539.  
  1540.          Page%        Display page to be written to 
  1541.  
  1542.  
  1543.  
  1544.       Programming notes: 
  1545.  
  1546.       All fields should be properly initialized before using this service. 
  1547.  
  1548.       The current cursor position is not affected by this service. 
  1549.  
  1550.  
  1551.       BSVWTTY  - Write in teletype mode 
  1552.  
  1553.       Usage - Call BsVWTTY(Text$, FgColor%, BgColor%) 
  1554.  
  1555.          Text$          Text to be written to the screen. 
  1556.  
  1557.          FgColor%       Foreground Color 
  1558.  
  1559.          BgColor        Background color 
  1560.  
  1561.  
  1562.       Programming notes: 
  1563.  
  1564.       This service recognizes special ASCII codes for bell, line feed, and back 
  1565.       space.  Any other characters are written to the screen and the cursor 
  1566.       position is advanced appropriately. 
  1567.  
  1568.       Do not mix this service with BASIC PRINT statements as the cursor posi 
  1569.       tioning will be inconsistent. 
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.                         Copyright (c) AJM Software 1987, 1991
  1577.                                 All Rights Reserved             Page 24
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.  
  1592.                               The BIOS Keyboard Services 
  1593.  
  1594.  
  1595.  
  1596.       Function Summary 
  1597.  
  1598.  
  1599.       BSKGET   - Get a character from the keyboard 
  1600.  
  1601.       BSKSTAT  - Determine the status of the toggle keys 
  1602.  
  1603.       BSKCLR   - Clear the keyboard buffer 
  1604.  
  1605.       BSKNXT   - Preview the keyboard buffer 
  1606.  
  1607.       BSKSTOG  - Set keyboard toggles 
  1608.  
  1609.       BSKTOGH  - Determine whether toggle keys are pressed 
  1610.  
  1611.       BSCURS   - Set cursor speed
  1612.  
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626.  
  1627.  
  1628.  
  1629.  
  1630.  
  1631.  
  1632.  
  1633.  
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.                         Copyright (c) AJM Software 1987, 1991
  1643.                                 All Rights Reserved             Page 25
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.   
  1658.       BSKGET   - Get a character from the keyboard 
  1659.  
  1660.       Usage - Call BsKGet(Char$, Scancode%) 
  1661.  
  1662.          Char$        The character entered at the keyboard. 
  1663.  
  1664.          Scancode%    The scan code of the character entered at the keyboard. 
  1665.                       A partial list of scancodes is provided in Appendix A. 
  1666.  
  1667.  
  1668.       Programming notes: 
  1669.  
  1670.       This function retrieves the next character in the keyboard buffer.  If 
  1671.       there is nothing in the buffer, it will wait until a character is ready 
  1672.       and thereby suspend program execution.  BSKNXT, discussed later, will 
  1673.       allow you to peek into the keyboard buffer to determine if a key has been 
  1674.       pressed without suspending the program. 
  1675.  
  1676.       Char$ will either the standard ASCII code of the key pressed or CHR$(0) if 
  1677.       a special key was pressed (i.e. the function keys, PgUp, Home, etc.).  If 
  1678.       Char$ is a CHR$(0), then Scancode% will indicate which key was pressed. 
  1679.       See Appendix A for a list of scancodes. 
  1680.  
  1681.  
  1682.       BSKSTAT  - Determine the status of the toggle keys 
  1683.  
  1684.       Usage - 
  1685.       Call BsKStat(Insert%, Caps%, Num%, Scroll%, Alt%, Ctrl%, LShift%, RShift%) 
  1686.  
  1687.  
  1688.       Programming notes: 
  1689.  
  1690.       For Insert%, Caps%, Num%, and Scroll% - If the returned value is 1, then 
  1691.       that mode has been toggled on (i.e. - Caps light is on).  If the value 
  1692.       returned is 0, then that mode has been toggled off. 
  1693.  
  1694.       For Alt%, Ctrl%, LShift%, RShift% - If the returned value is 1, then that 
  1695.       key is currently depressed.  If the value is 0, then that key is not 
  1696.       depressed. 
  1697.  
  1698.  
  1699.       BSKCLR   - Clear the keyboard buffer 
  1700.  
  1701.       Usage - Call BsKClr 
  1702.  
  1703.  
  1704.       Programming notes: 
  1705.  
  1706.       BSKCLR is not passed any parameters, nor does it return any values.  It 
  1707.  
  1708.                         Copyright (c) AJM Software 1987, 1991
  1709.                                 All Rights Reserved             Page 26
  1710.  
  1711.  
  1712.  
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.       simply clears any keystrokes that have not been read into your program but 
  1724.       are waiting in the keyboard buffer. 
  1725.  
  1726.   
  1727.       BSKNXT   - Preview the keyboard buffer 
  1728.  
  1729.       Usage - Call BsKNxt(Char$, Scancode%, Rc%) 
  1730.  
  1731.          Char$        The character entered at the keyboard. 
  1732.  
  1733.          Scancode%    The scan code of the character entered at the keyboard. 
  1734.                       A partial list of scancodes is provided in Appendix A. 
  1735.  
  1736.          Rc%          Return code 0 indicates that no key has been pressed. 
  1737.                       Return code 1 indicates that a key has been pressed. 
  1738.  
  1739.  
  1740.       Programming notes: 
  1741.  
  1742.       This function will not remove a character from the keyboard buffer.  If 
  1743.       the return code indicates that a character is in the buffer, you must use 
  1744.       BSKGET to get the character out of the buffer. 
  1745.  
  1746.       See notes for BSKGET and Appendix A. 
  1747.  
  1748.  
  1749.       BSKSTOG  - Set keyboard toggles 
  1750.  
  1751.       Usage - Call BsKSTog(Insert%, Caps%, Num%, Scroll%) 
  1752.  
  1753.  
  1754.       Programming notes: 
  1755.  
  1756.       Each parameter must be initialized to 0 or 1.  If the parameter is ini 
  1757.       tialized to 1 then that toggle will be turned on.  If the parameter is 0 
  1758.       then that toggle will be turned off.  For example: 
  1759.  
  1760.          Call BsKSTog(0,1,1,0) 
  1761.  
  1762.       will turn CapsLock and NumLock on, and it will turn ScrollLock and Insert 
  1763.       mode off. 
  1764.  
  1765.  
  1766.       BSKTOGH  - Determine whether toggle keys are pressed 
  1767.  
  1768.       Usage - Call BsKTogH(Insert%, Caps%, Num%, Scroll%) 
  1769.  
  1770.  
  1771.       Programming notes: 
  1772.  
  1773.  
  1774.                         Copyright (c) AJM Software 1987, 1991
  1775.                                 All Rights Reserved             Page 27
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786.  
  1787.  
  1788.  
  1789.       No parameters need to be initialized prior to making this call.  If any of 
  1790.       the returned values is 1, that indicates that the corresponding key is 
  1791.       currently being held down.  If any of the returned values is 0, that indi 
  1792.       cates that the corresponding key is not currently being held down. 
  1793.  
  1794.       Note that this function does not tell us the status of the toggle keys, 
  1795.       only whether or not someone is physically pressing them at that moment. 
  1796.  
  1797.  
  1798.       BSCURS   - Set cursor speed
  1799.  
  1800.       Usage - Call BsCurs(Dlay%, Rate%)
  1801.  
  1802.           Dlay%     0 - 250 ms delay before repeat key is generated
  1803.                     1 - 500 ms delay
  1804.                     2 - 750 ms delay 
  1805.                     3 - 1000 ms delay
  1806.  
  1807.           Rate%     Can vary from 0 thru  31 with 0 causing a  repeat rate of 30  cps
  1808.                     and 31 causing a repeat rate of 2 cps.
  1809.  
  1810.      Programming Notes:
  1811.  
  1812.      This function will not  work on an 8088/8086 (PC/XT) processor.   It can be used
  1813.      to vary keyboard action from very fast (Dlay%=0, Rate%=0) to very slow (Dlay%=4,
  1814.      Rate%=31).
  1815.  
  1816.  
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823.  
  1824.  
  1825.  
  1826.  
  1827.  
  1828.  
  1829.  
  1830.  
  1831.  
  1832.  
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.                         Copyright (c) AJM Software 1987, 1991
  1841.                                 All Rights Reserved             Page 28
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.                               The BIOS Diskette Services 
  1857.  
  1858.  
  1859.  
  1860.       Function Summary 
  1861.  
  1862.  
  1863.       BSDSTAT  - Get diskette controller status 
  1864.  
  1865.       BSDRESET - Reset floppy disk controller 
  1866.  
  1867.       BSDVRFY  - Verify sectors on a diskette 
  1868.  
  1869.       BSDREAD  - Read a sector from a diskette 
  1870.  
  1871.       BSDWRIT  - Write a sector to diskette 
  1872.  
  1873.       BSDFMT   - Format a track on a diskette 
  1874.  
  1875.  
  1876.  
  1877.       *********************** IMPORTANT ************************* 
  1878.  
  1879.       Before using any of these functions, please read the documentation care 
  1880.       fully and when testing your programs, please use blank diskettes.  These 
  1881.       functions will also work with a hard disk, so if you have a hard disk 
  1882.       installed, please take extra precautions.
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906.                         Copyright (c) AJM Software 1987, 1991
  1907.                                 All Rights Reserved             Page 29
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.       BSDSTAT  - Get diskette controller status 
  1923.  
  1924.       Usage Call BsDStat(Rc%) 
  1925.  
  1926.       Rc%     Reason - Diskette drives only 
  1927.  
  1928.       0       Successful 
  1929.       1       Invalid function 
  1930.       2       Address mark not found 
  1931.       3       Write protect error 
  1932.       4       Sector not found 
  1933.       6       Diskette change detected 
  1934.       8       DMA failure 
  1935.       9       DMA boundary overrun 
  1936.       16      bad CRC: parity check 
  1937.       32      controller malfunction 
  1938.       64      seek failure - move to requested track failed 
  1939.       128     time out - drive did not respond (the door is open) 
  1940.  
  1941.       Rc%     Reason - Hard disk drives only 
  1942.  
  1943.       0       Successful 
  1944.       1       Invalid function 
  1945.       2       Address mark not found 
  1946.       4       Sector not found 
  1947.       5       Reset failed 
  1948.       7       Drive parameter activity failed 
  1949.       9       DMA boundary overrun 
  1950.       10      Bad block flag detected 
  1951.       16      Uncorrectable ECC data error 
  1952.       17      ECC corrected data error 
  1953.       32      controller malfunction 
  1954.       64      seek failure - move to requested track failed 
  1955.       128     time out - drive did not respond 
  1956.       170     Drive not ready 
  1957.       187     Undefined error occured 
  1958.       204     Write fault active 
  1959.       255     Sense operation failed 
  1960.  
  1961.  
  1962.       Programming notes: 
  1963.  
  1964.       This function always returns the status of the last disk operation. 
  1965.  
  1966.       The messages normally seen when accessing a diskette with DOS, such as: 
  1967.          Not ready error reading drive a 
  1968.          Abort, Retry, Ignore 
  1969.       will not be seen when using this function (and any other BIOS diskette 
  1970.       function), therefore, you must always determine whether a disk operation 
  1971.  
  1972.                         Copyright (c) AJM Software 1987, 1991
  1973.                                 All Rights Reserved             Page 30
  1974.  
  1975.  
  1976.  
  1977.  
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.  
  1984.  
  1985.  
  1986.  
  1987.       has failed or succeeded when using the BIOS disk services. 
  1988.  
  1989.  
  1990.  
  1991.  
  1992.       BSDRESET - Reset floppy disk controller 
  1993.  
  1994.       Usage - Call BsDReset 
  1995.  
  1996.  
  1997.       Programming notes: 
  1998.  
  1999.       This function resets the disk controller and prepares it for I/O.  It will 
  2000.       force the BIOS diskette support routines to recalibrate the disk drive's 
  2001.       read/write head.  It should be used only after an error is detected during 
  2002.       a disk drive operation. 
  2003.  
  2004.   
  2005.       BSDVRFY  - Verify sectors on a disk 
  2006.  
  2007.       Usage - Call BsDVrfy(Buffer$, Drive$, Head%, Track%, Sector%, Rc%) 
  2008.  
  2009.          Buffer$        Not used for this function. 
  2010.  
  2011.          Drive$         Letter designation for to drive containing the diskette 
  2012.                         to be verified. 
  2013.  
  2014.          Head%          Cylinder head 
  2015.  
  2016.          Track%         Track containing sector to be verified. 
  2017.  
  2018.          Sector%        Relative ID of the sector to be verified. 
  2019.  
  2020.          Rc%            Return code - see function BSDSTAT 
  2021.  
  2022.  
  2023.       Programming notes: 
  2024.  
  2025.       For 1.2 Meg drives, the diskette drive parameter table must reflect the 
  2026.       type of media installed for correct operation.  It is the responsibility 
  2027.       of the programmer to ensure that the diskette drive parameter table is 
  2028.       correct.  Unpredictable results can occur otherwise (See BSDASTYP). 
  2029.  
  2030.  
  2031.       This service will verify only a single sector with each call.  If needed, 
  2032.       the Assembler source can easily be modified to verify more than one 
  2033.       sector (up to an entire track). 
  2034.  
  2035.       The verify service reads the specified sector and insures that it passes 
  2036.       the CRC check. 
  2037.  
  2038.                         Copyright (c) AJM Software 1987, 1991
  2039.                                 All Rights Reserved             Page 31
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.       See Appendix C - Miscellaneous diskette information. 
  2055.  
  2056.  
  2057.       BSDREAD  - Read a sector from a disk 
  2058.  
  2059.       Usage - Call BsDRead(Buffer$, Drive$, Head%, Track%, Sector%, Rc%) 
  2060.  
  2061.          Buffer$        The string where the data read from disk will be placed 
  2062.                         into. 
  2063.  
  2064.          Drive$         Letter designation for to drive containing the disk 
  2065.                         to be read. 
  2066.  
  2067.          Head%          Cylinder head containing the track to be read. 
  2068.  
  2069.          Track%         Track containing sector to be read. 
  2070.  
  2071.          Sector%        Relative ID of the sector to be read. 
  2072.  
  2073.          Rc%            Return code - see function BSDSTAT 
  2074.  
  2075.  
  2076.       Programming notes: 
  2077.  
  2078.       It is the responsibility of the programmer to ensure that Buffer$ is long 
  2079.       enough to hold the sector read from disk (usually 512 bytes).  If it is 
  2080.       not long enough, the results are unpredictable.  Generally you will see a 
  2081.       'String Space Corrupt' message returned from BASIC. 
  2082.  
  2083.       This service will read only a single sector with each call.  If necessary, 
  2084.       the Assembler source can easily be modified to read more than one sector 
  2085.       (up to an entire track). 
  2086.  
  2087.       See Appendix C - Miscellaneous diskette information. 
  2088.  
  2089.  
  2090.       BSDWRIT  - Write a sector to disk 
  2091.  
  2092.       Usage - Call BsDWrit(Buffer$, Drive$, Head%, Track%, Sector%, Rc%) 
  2093.  
  2094.          Buffer$        The string containing the data to be written to disk. 
  2095.  
  2096.          Drive$         Letter designation for to drive containing the disk 
  2097.                         to be written 
  2098.  
  2099.          Head%          Cylinder head containing the track to be written. 
  2100.  
  2101.          Track%         Track containing sector to be written. 
  2102.  
  2103.  
  2104.                         Copyright (c) AJM Software 1987, 1991
  2105.                                 All Rights Reserved             Page 32
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.          Sector%        Relative ID of the sector to be written. 
  2120.  
  2121.          Rc%            Return code - see function BSDSTAT 
  2122.  
  2123.  
  2124.       Programming notes: 
  2125.  
  2126.       When testing, first backup your diskette.  It is very easy to inadver 
  2127.       tently erase usable data or render a diskette unusable with this service. 
  2128.  
  2129.       This service will always write a complete sector.  If Buffer$ is shorter 
  2130.       than the length of a sector (usually 512 bytes), the contents of the sec 
  2131.       tor written will be unpredictable. 
  2132.  
  2133.       This service will write only a single sector with each call.  If needed, 
  2134.       the Assembler source can easily be modified to write more than one sector 
  2135.       (up to an entire track). 
  2136.  
  2137.       See Appendix C - Miscellaneous diskette information. 
  2138.  
  2139.  
  2140.       BSDFMT   - Format a track on a disk 
  2141.  
  2142.       Usage - Call BsDFmt(Buffer$, Drive$, Head%, Track%, Sector%, Rc%) 
  2143.  
  2144.          Buffer$        The string containing the track format table (See Appen 
  2145.                         dix C). 
  2146.  
  2147.          Drive$         Letter designation for to drive containing the diskette 
  2148.                         to be formatted. 
  2149.  
  2150.          Head%          Cylinder head containing the track to be formatted. 
  2151.  
  2152.          Track%         Track containing sector to be formatted. 
  2153.  
  2154.          Sector%        Number of sectors to be formatted. 
  2155.  
  2156.          Rc%            Return code - see function BSDSTAT 
  2157.  
  2158.  
  2159.       Programming notes: 
  2160.  
  2161.  
  2162.       For 1.2 Meg drives, the diskette drive parameter table must reflect the 
  2163.       type of media installed for correct operation.  It is the responsibility 
  2164.       of the programmer to ensure that the diskette drive parameter table is 
  2165.       correct.  Unpredictable results can occur otherwise (See BSDASTYP). 
  2166.  
  2167.       When testing, first backup your diskette.  It is very easy to inadver 
  2168.       tently erase usable data or render a diskette unusable with this service. 
  2169.  
  2170.                         Copyright (c) AJM Software 1987, 1991
  2171.                                 All Rights Reserved             Page 33
  2172.  
  2173.  
  2174.  
  2175.  
  2176.  
  2177.  
  2178.  
  2179.  
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.       This service will always format a complete track.  If Sector% is less than 
  2187.       the maximum number of sectors that can fit on that track, then the unfor 
  2188.       matted sectors will no longer be available. 
  2189.  
  2190.       If you format track 0 on a diskette with this service, the diskette will 
  2191.       not be usable until a boot record is written to sector 0.  If needed, the 
  2192.       Assembler source code can be modified to write a boot record to the dis 
  2193.       kette. 
  2194.  
  2195.  
  2196.  
  2197.  
  2198.  
  2199.  
  2200.  
  2201.  
  2202.  
  2203.  
  2204.  
  2205.  
  2206.  
  2207.  
  2208.  
  2209.  
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.  
  2233.  
  2234.  
  2235.  
  2236.                         Copyright (c) AJM Software 1987, 1991
  2237.                                 All Rights Reserved             Page 34
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.                            The BIOS Miscellaneous Services 
  2253.  
  2254.  
  2255.  
  2256.       Function Summary 
  2257.  
  2258.  
  2259.       BSEQPMT  - Get installed equipment 
  2260.  
  2261.       BSPINIT  - Initialize printer 
  2262.  
  2263.       BSPSTAT  - Get printer status 
  2264.  
  2265.       BSPRINT  - Print a string of characters 
  2266.  
  2267.       BSPRTSC  - Print screen 
  2268.  
  2269.  
  2270.  
  2271.  
  2272.  
  2273.  
  2274.  
  2275.  
  2276.  
  2277.  
  2278.  
  2279.  
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286.  
  2287.  
  2288.  
  2289.  
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.                         Copyright (c) AJM Software 1987, 1991
  2303.                                 All Rights Reserved             Page 35
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314.  
  2315.  
  2316.  
  2317.  
  2318.       BSEQPMT  - Get installed equipment 
  2319.  
  2320.       Usage - 
  2321.       Call BsEqpmt(RomDate$, RAM%, ExtRAM%, ExpRAM%, Printers%, RS232%, 
  2322.       Floppies%, Gameport%, Disks%) 
  2323.  
  2324.          RomDate$       ROM-BIOS revision date 
  2325.  
  2326.          RAM%           Amount, in Kilobytes, of installed RAM. 
  2327.  
  2328.          ExtRAM%        Amount, in Kilobytes, of extended memory. 
  2329.  
  2330.          ExpRAM%        Amount, in 16K pages, of LIMM expanded memory. 
  2331.  
  2332.          Printers%      Number of printer ports installed. 
  2333.  
  2334.          Rs232%         Number of serial ports installed. 
  2335.  
  2336.          Floppies%      Number of floppy disk drives installed. 
  2337.  
  2338.          Gameport%      Number of gameports installed. 
  2339.  
  2340.          Disks%         Number of hard disks installed. 
  2341.  
  2342.  
  2343.       Programming notes: 
  2344.  
  2345.       Some of these fields may not be reliable in certain hardware configura 
  2346.       tions.  Items to be wary about are RomDate$, ExtRAM%, and in particular, 
  2347.       the number of hard disks.  The  presence of 386 memory manager programs such as
  2348. 386MAX and QEMM will invalidate the number returned in ExtRAM%. 
  2349.  
  2350.   
  2351.       BSPINIT  - Initialize printer 
  2352.  
  2353.       Usage - Call BsPInit(Printer%, Rc%) 
  2354.  
  2355.          Printer%       The printer port number - 0 is LPT1, 1 is LPT2, etc. 
  2356.  
  2357.          Rc%            Return code - see BSPSTAT 
  2358.  
  2359.  
  2360.       Programming notes: 
  2361.  
  2362.       This service will initialize the printer.  That is to say, it will: 
  2363.  
  2364.          - Reset top-of-form 
  2365.          - Return the printer to its default setup 
  2366.          - poll the printer for printer status 
  2367.  
  2368.                         Copyright (c) AJM Software 1987, 1991
  2369.                                 All Rights Reserved             Page 36
  2370.  
  2371.  
  2372.  
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379.  
  2380.  
  2381.  
  2382.  
  2383.  
  2384.  
  2385.       BSPSTAT  - Get printer status 
  2386.  
  2387.       Usage - Call BsPStat(Printer%, Rc%) 
  2388.  
  2389.          Printer%       The printer port number - 0 is LPT1, 1 is LPT2, etc. 
  2390.  
  2391.          Rc%            Return code 
  2392.  
  2393.  
  2394.       Programming notes: 
  2395.  
  2396.       The return code is actually a series of bit settings that indicates the 
  2397.       following conditions: 
  2398.  
  2399.          -  Printer ready 
  2400.          -  Acknowledge 
  2401.          -  Out of paper 
  2402.          -  I/O error (on some printers, this indicates an off-line condition) 
  2403.          -  Timeout 
  2404.          -  Selected 
  2405.  
  2406.       When checking printer status, the 'selected' indicator tells you that the 
  2407.       printer is on-line and ready to go.  Some printers will return a "Printer 
  2408.       ready' status even when turned off (this, incidentally, is why Quickbasic 
  2409.       will occasionally print to a printer that is turned off and never return 
  2410.       an error condition).  Before issuing an LPRINT (or equivalent) command in 
  2411.       Quickbasic, make sure that the printer is selected. 
  2412.  
  2413.       The following code segment will extract the appropriate values.  It is 
  2414.       included in the sample program archive(Registered owners only). 
  2415.  
  2416.  
  2417.       Printer%          = 0                     'Use LPT1 
  2418.       Call BsPStat(Printer%, Rc%)               'Get status of printer 
  2419.  
  2420.       Printer.Ready%  =  (Rc% and 128) = 128   '1st bit indicates printer ready 
  2421.       Acknowledge%    =  (Rc% and 64)  = 64    '2nd bit indicates Ack 
  2422.       Out.of.Paper%   =  (Rc% and 32)  = 32    '3rd bit indicates out of paper 
  2423.       IO.Error%       =  (Rc% and 8)   = 8     '5th bit indicates I/O Error 
  2424.       Timeout%        =  (Rc% and 1)   = 1     '8th bit indicates Timeout 
  2425.       Selected%       =  (Rc% and 16)  = 16    '4th bit indicates Selected 
  2426.  
  2427.       Locate 1,1: Color 15,1: Cls 
  2428.  
  2429.       If Printer.Ready% then 
  2430.          Print "Printer at LPT1 reports Ready" 
  2431.       End if 
  2432.  
  2433.  
  2434.                         Copyright (c) AJM Software 1987, 1991
  2435.                                 All Rights Reserved             Page 37
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.       If Acknowledge% then 
  2450.          Print "Printer at LPT1 reports Acknowledge" 
  2451.       End if 
  2452.  
  2453.       If Out.of.Paper% then 
  2454.          Print "Printer at LPT1 reports Out of Paper of Paper jam" 
  2455.       End if 
  2456.  
  2457.       If IO.Error% then 
  2458.          Print "Printer at LPT1 reports I/O error or Printer off-line" 
  2459.       End if 
  2460.  
  2461.       If Timeout% then 
  2462.          Print "Printer at LPT1 has timed out" 
  2463.       End if 
  2464.  
  2465.       If Selected% then 
  2466.          Print "Printer at LPT1 is selected" 
  2467.       End if 
  2468.  
  2469.  
  2470.       BSPRINT  - Print a string of characters 
  2471.  
  2472.       Usage - Call BsPrint(Text$, Printer%, Rc%) 
  2473.  
  2474.          Text$          String to print 
  2475.  
  2476.          Printer%       Printer port 
  2477.  
  2478.          Rc%            Return code 
  2479.  
  2480.  
  2481.       Programming notes: 
  2482.  
  2483.       See BSPSTAT for an explanation of return codes. 
  2484.  
  2485.       This service sends whatever is in Text$ to the appropriate printer port. 
  2486.       All special printer codes such as NewLine, TopofForm, etc, will be inter 
  2487.       preted correctly by the printer. 
  2488.  
  2489.   
  2490.       BSPRTSC  - Print screen 
  2491.  
  2492.       Usage - Call BsPrtSc 
  2493.   
  2494.       Programming notes: 
  2495.       This service is the equivalent of pressing the 'PrtSc' key on the key 
  2496.       board. 
  2497.  
  2498.       The screen will be printed to LPT1. 
  2499.  
  2500.                         Copyright (c) AJM Software 1987, 1991
  2501.                                 All Rights Reserved             Page 38
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.                               The BIOS AT Disk Services 
  2517.  
  2518.  
  2519.  
  2520.       Function Summary 
  2521.  
  2522.  
  2523.       BSDAPARM - Get current drive parameters 
  2524.  
  2525.       BSDATST  - Test for drive ready 
  2526.  
  2527.       BSDARST  - Alternate disk reset 
  2528.  
  2529.       BSDARCL  - Recalibrate drive 
  2530.  
  2531.       BSDADIAG - Perform controller diagnostics 
  2532.  
  2533.       BSDASTAT - Detect diskette change 
  2534.  
  2535.       BSDATYPE - Get disk type 
  2536.  
  2537.       BSDASTYP - Set diskette type 
  2538.  
  2539.       BSDASEEK - Position heads over a specified cylinder 
  2540.  
  2541.  
  2542.  
  2543.       *********************** IMPORTANT ************************* 
  2544.  
  2545.       These functions are documented only for AT type machines.  These machines 
  2546.       generally use a 1.2 Meg diskette drive whose characteristics are different 
  2547.       enough from the 360KB drive to warrant these new BIOS services.  These 
  2548.       services also provide additional support for hard disks. 
  2549.  
  2550.  
  2551.  
  2552.  
  2553.  
  2554.  
  2555.  
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562.  
  2563.  
  2564.  
  2565.  
  2566.                         Copyright (c) AJM Software 1987, 1991
  2567.                                 All Rights Reserved             Page 39
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.       BSDAPARM - Get current drive parameters 
  2583.  
  2584.       Usage - Call BsDAParm(Drive$, Heads%, Cylinders%, Sectors%) 
  2585.  
  2586.          Drive$         Letter designation of the target drive 
  2587.  
  2588.          Heads%         Maximum number of heads on the disk 
  2589.  
  2590.          Cylinders%     Maximum number of Cylinders/Head 
  2591.  
  2592.          Sectors%       Maximum number of Sectors/Cylinder 
  2593.  
  2594.  
  2595.       Programming notes: 
  2596.  
  2597.       This service will not function on a diskette drive.  It is intended for 
  2598.       use with a hard disk only. 
  2599.  
  2600.   
  2601.       BSDATST  - Test for drive ready 
  2602.  
  2603.       Usage - Call DsDATst(Drive$, Rc%) 
  2604.  
  2605.          Drive$         Letter designation of the target drive 
  2606.  
  2607.          Rc%            Return code 
  2608.  
  2609.  
  2610.       Programming notes: 
  2611.  
  2612.       This service will not function on a diskette drive.  It is intended for 
  2613.       use with a hard disk only. 
  2614.  
  2615.       This service tests the status of the DRIVE READY signal on the selected 
  2616.       drive. 
  2617.  
  2618.       See BSDSTAT documentation for an explanation of return codes. 
  2619.  
  2620.  
  2621.       BSDARST  - Alternate disk reset 
  2622.  
  2623.       Usage - Call BsDARst(Drive$, Rc%) 
  2624.  
  2625.          Drive$         Letter designation of the target drive 
  2626.  
  2627.          Rc%            Return code 
  2628.  
  2629.  
  2630.       Programming notes: 
  2631.  
  2632.                         Copyright (c) AJM Software 1987, 1991
  2633.                                 All Rights Reserved             Page 40
  2634.  
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640.  
  2641.  
  2642.  
  2643.  
  2644.  
  2645.  
  2646.  
  2647.  
  2648.       This service is the same as BSDRESET documented earlier except that 
  2649.       BSDARST can be used only with hard disk controllers. 
  2650.  
  2651.       See BSDSTAT documentation for an explanation of return codes. 
  2652.  
  2653.  
  2654.       BSDARCL  - Recalibrate drive 
  2655.  
  2656.       Usage - Call BsDARcl(Drive$, Rc%) 
  2657.  
  2658.          Drive$         Letter designation of the target drive 
  2659.  
  2660.          Rc%            Return code 
  2661.  
  2662.  
  2663.       Programming notes: 
  2664.  
  2665.       This service will not function on a diskette drive.  It is intended for 
  2666.       use with a hard disk only. 
  2667.  
  2668.       This service instructs the specified drive to recalibrate.  This is done 
  2669.       by seeking track 0. 
  2670.  
  2671.       This service should be used only after an error has been detected and 
  2672.       before any retries are made. 
  2673.  
  2674.       See BSDSTAT documentation for an explanation of return codes. 
  2675.  
  2676.  
  2677.       BSDADIAG - Perform controller diagnostics 
  2678.  
  2679.       Usage BsDADiag(Rc%) 
  2680.  
  2681.          Rc%            Return code 
  2682.  
  2683.  
  2684.       Programming notes: 
  2685.  
  2686.       This service will not function on a diskette drive.  It is intended for 
  2687.       use with a hard disk only. 
  2688.  
  2689.       This service instructs the hard disk controller to perform its internal 
  2690.       diagnostic routines. 
  2691.  
  2692.       See BSDSTAT documentation for an explanation of return codes. 
  2693.  
  2694.  
  2695.       BSDASTAT - Detect diskette change 
  2696.  
  2697.  
  2698.                         Copyright (c) AJM Software 1987, 1991
  2699.                                 All Rights Reserved             Page 41
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711.  
  2712.  
  2713.       Usage - Call BsDAStat(Drive$, Rc%) 
  2714.  
  2715.          Drive$         Letter designation of the target drive 
  2716.  
  2717.          Rc%            Return code 
  2718.  
  2719.  
  2720.       Programming notes: 
  2721.  
  2722.       This service will detect whether or not the disk drive door has been 
  2723.       opened since the last disk operation.  It is meaningless for hard drives. 
  2724.  
  2725.       This service should be used only with those drives that can detect disk 
  2726.       changes (See BSDATYPE). 
  2727.  
  2728.       See BSDSTAT documentation for an explanation of return codes. 
  2729.  
  2730.  
  2731.       BSDATYPE - Get disk type 
  2732.  
  2733.       Usage - Call BsDAType(Drive$, Rc%) 
  2734.  
  2735.          Drive$         Letter designation of the target drive 
  2736.  
  2737.          Rc%            0 - drive is not present 
  2738.                         1 - diskette without change detection 
  2739.                         2 - diskette with change detection% 
  2740.                         3 - fixed disk 
  2741.  
  2742.  
  2743.       Programming notes: 
  2744.  
  2745.       This service will work with both hard and floppy disk drives. 
  2746.  
  2747.   
  2748.       BSDASTYP - Set diskette type 
  2749.  
  2750.       Usage - Call BsDASTyp(Drive$, Type%, Rc%) 
  2751.  
  2752.          Drive$         Letter designation of the target drive 
  2753.  
  2754.          Type%          1 - Double-density drive 
  2755.                         2 - 360KB diskette in a 1.2MB drive 
  2756.                         3 - 1.2MB diskette in a 1.2MB drive 
  2757.  
  2758.          Rc%            Return code 
  2759.  
  2760.  
  2761.       Programming notes: 
  2762.  
  2763.  
  2764.                         Copyright (c) AJM Software 1987, 1991
  2765.                                 All Rights Reserved             Page 42
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778.  
  2779.       This service is meaningless for fixed disks. 
  2780.  
  2781.       This service should be used prior to all Format and Verify requests to any 
  2782.       1.2MB diskette drives. 
  2783.  
  2784.       See BSDSTAT for an explanation of return codes. 
  2785.  
  2786.  
  2787.       BSDASEEK - Position heads over a specified cylinder 
  2788.  
  2789.       Usage - Call BsDASeek(Drive$, Head%, Cylinder%, Rc%) 
  2790.  
  2791.          Drive$         Letter designation of the target drive 
  2792.  
  2793.          Head%          Head to be positioned 
  2794.  
  2795.          Cylinder%      Cylinder over which the head will be positioned. 
  2796.  
  2797.          Rc%            Return code 
  2798.  
  2799.  
  2800.       Programming notes: 
  2801.  
  2802.       This service will not function on a diskette drive.  It is intended for 
  2803.       use with a hard disk only. 
  2804.  
  2805.       This service can be used to park your fixed disk 
  2806.  
  2807.       See BSDSTAT for an explanation of return codes. 
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816.  
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.                         Copyright (c) AJM Software 1987, 1991
  2831.                                 All Rights Reserved             Page 43
  2832.  
  2833.  
  2834.  
  2835.  
  2836.  
  2837.  
  2838.  
  2839.  
  2840.  
  2841.  
  2842.  
  2843.  
  2844.  
  2845.  
  2846.                              The File Attribute Services 
  2847.  
  2848.  
  2849.       Function Summary 
  2850.  
  2851.  
  2852.       FLGTIM   - Get file creation time 
  2853.  
  2854.       FLGDAT   - Get file creation date 
  2855.  
  2856.       FLGVOL   - Get volume label 
  2857.  
  2858.       FLPDAT   - Change file creation date and time 
  2859.  
  2860.       FLPVOL   - Change volume label 
  2861.  
  2862.       FLATTR   - Change file attributes 
  2863.  
  2864.  
  2865.  
  2866.  
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882.  
  2883.  
  2884.  
  2885.  
  2886.  
  2887.  
  2888.  
  2889.  
  2890.  
  2891.  
  2892.  
  2893.  
  2894.  
  2895.  
  2896.                         Copyright (c) AJM Software 1987, 1991
  2897.                                 All Rights Reserved             Page 44
  2898.  
  2899.  
  2900.  
  2901.  
  2902.  
  2903.  
  2904.  
  2905.  
  2906.  
  2907.  
  2908.  
  2909.  
  2910.  
  2911.  
  2912.       FLGTIM   - Get file creation time 
  2913.  
  2914.       Usage - Call FlGTim(FlSpec$, FlTime$, Rc%) 
  2915.  
  2916.          FlSpec$        Standard ASCIIZ file name 
  2917.  
  2918.          FlTime$        File creation time in HH:MM:SS format 
  2919.  
  2920.          Rc%            Return code 
  2921.  
  2922.  
  2923.       Programming notes: 
  2924.  
  2925.       See function FLFIND for additional capabilities. 
  2926.  
  2927.       An ASCIIZ string is the standard DOS filename followed by CHR$(0) 
  2928.  
  2929.       FlTime$ must be initialized to 8 blanks prior to calling FLGTIM.  If it is 
  2930.       not properly initialized, a 'String Space Corrupt' error may occur. 
  2931.  
  2932.       See Appendix D for valid return codes. 
  2933.  
  2934.       Use FLFIND instead of FLGTIM whenever possible because it is tremendously 
  2935.       faster. 
  2936.   
  2937.  
  2938.       FLGDAT   - Get file creation date 
  2939.  
  2940.       Usage - Call FlGDat(FlSpec$, FlDate$, Rc%) 
  2941.  
  2942.          FlSpec$        Standard ASCIIZ file name 
  2943.  
  2944.          FlDate$        File creation date in MM-DD-YYYY format 
  2945.  
  2946.          Rc%            Return code 
  2947.  
  2948.  
  2949.       Programming notes: 
  2950.  
  2951.       See function FLFIND for additional capabilities. 
  2952.  
  2953.       An ASCIIZ string is the standard DOS filename followed by CHR$(0) 
  2954.  
  2955.       FlDate$ must be initialized to 10 blanks prior to calling FLGDAT.  If it 
  2956.       is not properly initialized, a 'String Space Corrupt' error may occur. 
  2957.  
  2958.       See Appendix D for valid return codes. 
  2959.  
  2960.       Use FLFIND instead of FLGDAT whenever possible because it is tremendously 
  2961.  
  2962.                         Copyright (c) AJM Software 1987, 1991
  2963.                                 All Rights Reserved             Page 45
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.       faster. 
  2978.  
  2979.  
  2980.  
  2981.       FLGVOL   - Get volume label 
  2982.  
  2983.       Usage - Call FlGVol(Drive$, Vol$) 
  2984.  
  2985.          Drive$         Letter designation of drive 
  2986.  
  2987.          Vol$           Volume label of the target drive 
  2988.  
  2989.  
  2990.       Programming notes: 
  2991.  
  2992.       Vol$ must be initialized to 11 blanks prior to calling FLGVOL.  If it 
  2993.       is not properly initialized, the entire volume label may not be returned 
  2994.       in this field. 
  2995.  
  2996.       No return code is provided for this function.  If an invalid Drive letter 
  2997.       is passed or if the target drive does not have a volume label, the con 
  2998.       tents of Vol$ will remain unchanged. 
  2999.  
  3000.       If Drive$ is initialized to nulls (i.e. Drive$ = "").  The volume label of 
  3001.       the default drive is returned. 
  3002.  
  3003.      This function will not work properly with diskettes fromatted under DOC V4.00 or
  3004.      higher.
  3005.  
  3006.  
  3007.       FLPDAT   - Change file creation date and time 
  3008.  
  3009.       Usage - Call FlPDat(Flspec$, FlDate$, FlTime$, Rc%) 
  3010.  
  3011.          FlSpec$        Standard ASCIIZ file name 
  3012.  
  3013.          FlDate$        File creation date in MM-DD-YYYY format 
  3014.  
  3015.          FlTime$        File creation time in HH:MM:SS format 
  3016.  
  3017.          Rc%            Return code 
  3018.  
  3019.  
  3020.       Programming notes: 
  3021.  
  3022.       See function FLFIND for additional capabilities. 
  3023.  
  3024.       An ASCIIZ string is the standard DOS filename followed by CHR$(0) 
  3025.  
  3026.       FlDate$ must be initialized to a valid 10 character date prior to calling 
  3027.  
  3028.                         Copyright (c) AJM Software 1987, 1991
  3029.                                 All Rights Reserved             Page 46
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.       FLPDAT.  If an invalid date is used or a date that is not 10 characters 
  3044.       is used, FLPDAT will place garbage in the file creation date.  This is not 
  3045.       harmful to the date contained in the file, but may interfere with some 
  3046.       MAKE or Backup processes. 
  3047.  
  3048.       FlTime$ must be initialized to a valid 8 character time prior to calling 
  3049.       FLPDAT.  See discussion of FlDate$ for implications of using invalid 
  3050.       times. 
  3051.  
  3052.       See Appendix D for valid return codes. 
  3053.  
  3054.       FLPVOL   - Change volume label 
  3055.  
  3056.       Usage - Call FlPVol(Drive$, Vol$, Rc%) 
  3057.  
  3058.          Drive$         Letter designation of drive 
  3059.  
  3060.          Vol$           Volume label to be written to target drive 
  3061.  
  3062.          Rc%            Return code 
  3063.  
  3064.  
  3065.       Programming notes: 
  3066.  
  3067.       Vol$ must be initialized to an 11 character string before calling FLPVOL. 
  3068.       If it is not properly initialized, an incorrect volume label may be writ 
  3069.       ten to the disk. 
  3070.  
  3071.       See Appendix D for return codes. 
  3072.  
  3073.       If Drive$ is initialized to nulls (i.e. Drive$ = "").  The volume label of 
  3074.       the default drive is updated.
  3075.  
  3076.      This function will not work properly under DOS V4.00.
  3077.  
  3078.  
  3079.       FLATTR   - Change file attributes 
  3080.  
  3081.       Usage Call FlAttr(FlSpec$, Mode%, Attr%, Rc%) 
  3082.  
  3083.          FlSpec$        Standard ASCIIZ file name 
  3084.  
  3085.          Mode%          0 - Get attributes 
  3086.                         1 - Set attributes 
  3087.  
  3088.          Attr%          New file attributes (if Mode% = 1) or current file 
  3089.                         attributes (if Mode% = 0). 
  3090.  
  3091.          Rc%            Return code 
  3092.  
  3093.  
  3094.                         Copyright (c) AJM Software 1987, 1991
  3095.                                 All Rights Reserved             Page 47
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102.  
  3103.  
  3104.  
  3105.  
  3106.  
  3107.  
  3108.  
  3109.  
  3110.       Programming notes: 
  3111.  
  3112.       See function FLFIND for additional capabilities. 
  3113.  
  3114.       An ASCIIZ string is the standard DOS filename followed by CHR$(0) 
  3115.  
  3116.       Attr% is an integer between 0 and 63. Attributes are bit settings within 
  3117.       this number and they are represented as: 
  3118.  
  3119.               Normal    0 
  3120.               Readonly  1 
  3121.               Hidden    2 
  3122.               System    4 
  3123.               Volume    8 
  3124.               Subdir   16 
  3125.               Archive  32 
  3126.  
  3127.       The following code segment will interpret the Attr% field. 
  3128.  
  3129.  
  3130.          FlSpec$ = "command.com"+chr$(0)        'Target filename 
  3131.          Mode%   = 0                            'Indicate get attributes 
  3132.  
  3133.          Call FlAttr(FlSpec$, Mode%, Attr%, Rc%) 
  3134.  
  3135.          If Rc% <> 0 then goto Error.Routine    'Non-zero indicates failure 
  3136.  
  3137.          If Attr% = 0 then 
  3138.               Normal% = -1                      'zero indicates no special 
  3139.               Goto Print.Attr                   'attributes 
  3140.          End if 
  3141.  
  3142.          FRead%   = (Attr% and 1)  = 1          'Check for readonly attr 
  3143.          FHidden% = (Attr% and 2)  = 2          'Check for hidden attr 
  3144.  
  3145.          FSystem% = (Attr% and 4)  = 4          'Check for system attr 
  3146.          FVolume% = (Attr% and 8)  = 8          'Check for Volume label 
  3147.          FSubdir% = (Attr% and 16) = 16         'Check if its a sub-directory 
  3148.          FArcive% = (Attr% and 32) = 32         'Check if its been archived 
  3149.  
  3150.       Print.Attr: 
  3151.          Attributes$ = "" 
  3152.          If Normal%      then Attribute$ = "Normal " 
  3153.          If FRead%       then Attribute$ = "Read Only " 
  3154.          If Fhidden%     then Attribute$ = Attribute$ + "Hidden " 
  3155.          If Fsystem%     then Attribute$ = Attribute$ + "System " 
  3156.          If FSubdir%     then Attribute$ = Attribute$ + "Directory " 
  3157.          If FArcive%     then Attribute$ = Attribute$ + "Archive" 
  3158.  
  3159.  
  3160.                         Copyright (c) AJM Software 1987, 1991
  3161.                                 All Rights Reserved             Page 48
  3162.  
  3163.  
  3164.  
  3165.  
  3166.  
  3167.  
  3168.  
  3169.  
  3170.  
  3171.  
  3172.  
  3173.  
  3174.  
  3175.          Print "FlSpec$", Attribute$ 
  3176.  
  3177.  
  3178.       A program segment in the Sample programs (Registered copies only) shows 
  3179.       how to initialize Attr% to set attributes. 
  3180.  
  3181.  
  3182.  
  3183.  
  3184.  
  3185.  
  3186.  
  3187.  
  3188.  
  3189.  
  3190.  
  3191.  
  3192.  
  3193.  
  3194.  
  3195.  
  3196.  
  3197.  
  3198.  
  3199.  
  3200.  
  3201.  
  3202.  
  3203.  
  3204.  
  3205.  
  3206.  
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.                         Copyright (c) AJM Software 1987, 1991
  3227.                                 All Rights Reserved             Page 49
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.                                The File Access Services 
  3243.  
  3244.  
  3245.       Function Summary 
  3246.  
  3247.  
  3248.       FLSET    - Set number of file handles 
  3249.  
  3250.       FLOPEN   - Open a file 
  3251.  
  3252.       FLCLOS   - Close a file 
  3253.  
  3254.       FLREAD   - Read a record from a file 
  3255.  
  3256.       FLWRIT   - Write a record to a file 
  3257.  
  3258.       FLPOINT  - Point to a specific record in a file 
  3259.  
  3260.       FLCREAT  - Create a file 
  3261.  
  3262.       FLDELETE - Delete a file 
  3263.  
  3264.       FLRSECT  - Read a sector 
  3265.  
  3266.       FLWSECT  - Write a sector 
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276.  
  3277.  
  3278.  
  3279.  
  3280.  
  3281.  
  3282.  
  3283.  
  3284.  
  3285.  
  3286.  
  3287.  
  3288.  
  3289.  
  3290.  
  3291.  
  3292.                         Copyright (c) AJM Software 1987, 1991
  3293.                                 All Rights Reserved             Page 50
  3294.  
  3295.  
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.      FLSET    - Set number of available file handles
  3308.  
  3309.      Usage - Call FlSet(Handles%, Rc%) 
  3310.  
  3311.           Handles%       Maximum number of allowable files
  3312.  
  3313.           Rc%            Return code
  3314.  
  3315.      Programming notes:
  3316.  
  3317.      See Appendix D for an Explanation of return codes.
  3318.  
  3319.      This  function can be used to allow more than  15 open files at one time.  Under
  3320.      normal circumstances,  Quickbasic will  allow you  to open  the number  of files
  3321.      specified in your CONFIG.SYS.  QB will allocate 5 files at startup time.  If you
  3322.      specify FILES=10  in  your CONFIG.SYS,  QB uses  5  and allows  you to  use  the
  3323.      remaining 5 files - up to a maximum of 15.  This function allows you to increase
  3324.      the number of files you can open to about 60.  The actual DOS limit  is 255, but
  3325.      each file  requires space in your programs data  segment, so the practical limit
  3326.      becomes  about 60.  This will vary depending  upon your programs use of the near
  3327.      heap (strings, etc.).  
  3328.  
  3329.      This function will never allow you to open more files  than the number specified
  3330.      in the FILES line of your CONFIG.SYS.  If you want to open 40 files, you must do
  3331.      the following:
  3332.  
  3333.           -    place FILES=45 in config.sys (minimum)
  3334.           -    Call FlSet(45) (5 files for QB, 40 for your program
  3335.  
  3336.      This function is available only in DOS V3.30 or higher.
  3337.  
  3338.  
  3339.  
  3340.      FLOPEN   - Open a file 
  3341.  
  3342.       Usage - Call FlOpen(FlSpec$, Mode%, Share%, Handle%, Rc%) 
  3343.  
  3344.          FlSpec$        Valid ASCIIZ file name 
  3345.  
  3346.          Mode%          Specifies the use mode - valid values are: 
  3347.                                0 - Read only access 
  3348.                                1 - Write only access 
  3349.                                2 - Read/Write access 
  3350.  
  3351.          Share%         Specifies the file sharing mode in multi-tasking envi 
  3352.                         ronments.  Valid values are: 
  3353.                                1 - exclusive use 
  3354.                                2 - allow read access only 
  3355.                                3 - allow write access only 
  3356.                                4 - allow read/write access(full sharing) 
  3357.  
  3358.                         Copyright (c) AJM Software 1987, 1991
  3359.                                 All Rights Reserved             Page 51
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365.  
  3366.  
  3367.  
  3368.  
  3369.  
  3370.  
  3371.  
  3372.  
  3373.  
  3374.          Handle%        Token returned by DOS to identify the opened file. 
  3375.  
  3376.          Rc%            Return code 
  3377.  
  3378.  
  3379.       Programming notes: 
  3380.  
  3381.       See Appendix D for an explanation of return codes. 
  3382.  
  3383.       Share% is valid only for DOS 3.XX.  DOS 2.XX users should always have 
  3384.       Share% = 0. 
  3385.  
  3386.       This service will open a file with normal, system, or hidden attribute. 
  3387.  
  3388.       Handle% is an integer that DOS uses to identify the file.  Most of the 
  3389.       other services in this section of the manual require that Handle% be 
  3390.       passed to then. 
  3391.  
  3392.       After an open is successfully completed, the current record pointer is set 
  3393.       at the start of the file. 
  3394.  
  3395.   
  3396.       FLCLOS   - Close a file 
  3397.  
  3398.       Usage - Call FlClos(Handle%, Rc%) 
  3399.  
  3400.          Handle%        Handle of the file being closed. 
  3401.  
  3402.          Rc%            Return code 
  3403.  
  3404.  
  3405.       Programming notes: 
  3406.  
  3407.       See Appendix D for an explanation of return codes. 
  3408.  
  3409.       Handle% is the token returned by FLOPEN. Any file opened with FLOPEN must 
  3410.       be closed with FLCLOS. 
  3411.  
  3412.       Initializing Handle% improperly may have some unpredictable results, such 
  3413.       as locking the keyboard or disabling the printer and/or monitor. 
  3414.  
  3415.  
  3416.  
  3417.       FLREAD   - Read a record from a file 
  3418.  
  3419.       Usage - Call FlRead(Handle%, Databuf$, Buflen%, Rc%) 
  3420.  
  3421.          Handle%        Handle of the file being read. 
  3422.  
  3423.  
  3424.                         Copyright (c) AJM Software 1987, 1991
  3425.                                 All Rights Reserved             Page 52
  3426.  
  3427.  
  3428.  
  3429.  
  3430.  
  3431.  
  3432.  
  3433.  
  3434.  
  3435.  
  3436.  
  3437.  
  3438.  
  3439.          Databuf$       Data area where the record will be placed after success 
  3440.                         ful completion of the read. 
  3441.  
  3442.          Buflen%        Number of bytes to read.  FLREAD will return the actual 
  3443.                         number of bytes read. 
  3444.  
  3445.          Rc%            Return code 
  3446.  
  3447.  
  3448.       Programming notes: 
  3449.  
  3450.       See Appendix D for an explanation of return codes. 
  3451.  
  3452.       FLREAD returns the record being pointed to by the current record pointer. 
  3453.  
  3454.       After a successful read, FLREAD will update the current record to point to 
  3455.       the next record in the file. 
  3456.  
  3457.       Initialize Buflen% to the number of bytes that you would like to read. 
  3458.       FLREAD will update this field with the actual number of bytes read.  When 
  3459.       Buflen% is zero, or when it is less than it's initial value, end-of-file 
  3460.       has been reached. 
  3461.  
  3462.       It is the programmer's responsibility to insure that Databuf% is long 
  3463.       enough to accommodate the record read from disk.  If it is not initialized 
  3464.       properly, a 'String Space Corrupt' error will probably occur.  The follow 
  3465.       ing section of code shows a method of initializing Databuf$. 
  3466.  
  3467.               Buflen%  = 512                    'Number of bytes to read 
  3468.               Databuf$ = Space$(Buflen%)        'Create an adequate buffer 
  3469.  
  3470.  
  3471.       FLWRIT   - Write a record to a file 
  3472.  
  3473.       Usage - Call FlWrit(Handle%, Databuf$, Buflen%, Rc%) 
  3474.  
  3475.          Handle%        Handle of the file being written to. 
  3476.  
  3477.          Databuf$       Data area containing the record to be written. 
  3478.  
  3479.          Buflen%        Number of bytes to write. 
  3480.  
  3481.          Rc%            Return code 
  3482.  
  3483.  
  3484.       Programming notes: 
  3485.  
  3486.       See Appendix D for an explanation of return codes. 
  3487.  
  3488.       FLWRIT writes the record at the position pointed to by the current record 
  3489.  
  3490.                         Copyright (c) AJM Software 1987, 1991
  3491.                                 All Rights Reserved             Page 53
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.       pointer. 
  3506.  
  3507.       After a successful write, FLWRIT will update the current record to point 
  3508.       the next record in the file. 
  3509.  
  3510.       Initialize Buflen% to the number of bytes that you would like to write. 
  3511.       FLWRIT will update this field with the actual number of bytes written. 
  3512.       When Buflen% is zero, or when it is less than it's initial value, 
  3513.       a disk full condition has been reached. 
  3514.  
  3515.  
  3516.       FLPOINT  - Point to a specific record in a file 
  3517.  
  3518.       Usage - Call FlPoint(Handle%, Recno%, Reclen%, Rc%) 
  3519.  
  3520.          Handle%        Handle of the file being operated on. 
  3521.  
  3522.          Recno%         Record number that you would like to point to (relative 
  3523.                         to the beginning of the file). 
  3524.  
  3525.          Reclen%        Length of a logical record. 
  3526.  
  3527.          Rc%            Return code 
  3528.  
  3529.  
  3530.       Programming notes: 
  3531.  
  3532.       See Appendix D for an explanation of return codes. 
  3533.  
  3534.       DOS will use Recno% and Reclen% to compute the offset of the record within 
  3535.       the file.  This service updates the current record pointer. 
  3536.  
  3537.       Specifying Recno% = 0 will position you at the beginning of the file. 
  3538.  
  3539.       Specifying Recno% = -1 will position you at the end of the file (Useful 
  3540.       for adding records to the end of a file). 
  3541.  
  3542.       DOS does not perform boundary checks on this function, so specifying 
  3543.       Recno% or Reclen% improperly may set the current record pointer outside 
  3544.       the limits of the file. 
  3545.  
  3546.  
  3547.       FLCREAT  - Create a file 
  3548.  
  3549.       Usage Call FlCreat(FlSpec$, Mode%, Attr%,, Handle%, Rc%) 
  3550.  
  3551.          FlSpec$        Valid ASCIIZ filename (except for Mode% = 2) 
  3552.  
  3553.          Mode%          Indicates open actions: 
  3554.                         0 = Create the file if it doesn't exist - if it does 
  3555.  
  3556.                         Copyright (c) AJM Software 1987, 1991
  3557.                                 All Rights Reserved             Page 54
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563.  
  3564.  
  3565.  
  3566.  
  3567.  
  3568.  
  3569.  
  3570.  
  3571.                             exist, truncate the file. 
  3572.                         1 = Create the file if it doesn't exist - if it does 
  3573.                             exist this service will fail 
  3574.                         2 = Create a temporary file with a unique file name 
  3575.  
  3576.          Handle%        Handle assigned by DOS to the file 
  3577.  
  3578.          Attr%          File attributes assigned to this file. 
  3579.  
  3580.          Rc%            Return code 
  3581.  
  3582.  
  3583.       Programming notes: 
  3584.  
  3585.       See Appendix D for an explanation of return codes. 
  3586.  
  3587.       See the documentation on FLATTR for an explanation of what to put in 
  3588.       Attr% 
  3589.  
  3590.       When Mode% is 2 Dos will create a temporary file and the name of the file 
  3591.       will be returned in FlSpec$.  These files are not automatically deleted 
  3592.       when the program terminates.  That is the responsibility of the program 
  3593.       mer. 
  3594.  
  3595.       When a file is created, it is automatically opened for read/write access. 
  3596.       No subsequent open is required to access the file, but you must close the 
  3597.       file before the program terminates. 
  3598.  
  3599.       When Mode% is 2 FlSpec$ must be initialized properly prior to calling 
  3600.       FLCREAT.  It should consist of an ASCIIZ path name followed by 12 blanks. 
  3601.       For example: 
  3602.               FlSpec$ = Chr$(0) + Space$(12)    'Current directory 
  3603.               FlSpec$ = "C:\" + Chr$(0) + Space$(12)  'Root directory 
  3604.               FlSpec$ = "\TEMP" + Chr$(0) +Space$(12) '\TEMP directory 
  3605.  
  3606.  
  3607.       FLDELETE - Delete a file 
  3608.  
  3609.       Usage FlDelete(FlSpec$, Rc%) 
  3610.  
  3611.          Flspec$        Valid ASCIIZ filename 
  3612.  
  3613.          Rc%            Return code 
  3614.  
  3615.  
  3616.       Programming notes: 
  3617.  
  3618.       See Appendix D for an explanation of return codes. 
  3619.  
  3620.       FlSpec$ may not use wildcard characters. 
  3621.  
  3622.                         Copyright (c) AJM Software 1987, 1991
  3623.                                 All Rights Reserved             Page 55
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.  
  3638.       This service should be used to delete files created using Mode% = 2 with 
  3639.       FLCREAT (close it first before deleting it). 
  3640.  
  3641.  
  3642.       FLRSECT  - Read a sector 
  3643.  
  3644.       Usage - Call FlRSect(Numsect%, Databuf$, Sector%, Rc%) 
  3645.  
  3646.          Numsect%       Number of sectors to read 
  3647.  
  3648.          Databuf$       Data area where the data will be placed after successful 
  3649.                         completion of the read. 
  3650.  
  3651.          Sector%        Sector where read operation will start 
  3652.  
  3653.          Rc%            Return code 
  3654.  
  3655.  
  3656.       Programming notes: 
  3657.  
  3658.       Databuf$ must be long enough to hold the data read by this service.  If it 
  3659.       is not, you will probably get a 'String Space Corrupt' error.  Sectors are 
  3660.       generally 512 bytes.  You can find out by using FLDSTAT - explained later 
  3661.       in the manual. 
  3662.  
  3663.       Sector% is the relative sector from the beginning of the disk, starting 
  3664.       with sector 0. 
  3665.  
  3666.       A return code of 0 indicates successful completion.  There are a large 
  3667.       number of return codes that can indicate failure.  These will not be docu 
  3668.       mented here - if you really need them, write and we will gladly send them 
  3669.       to you. 
  3670.  
  3671.       If you are reading more than one sector, the sectors will be retrieved 
  3672.       sequentially starting at Sector%.  e.g. if Sector% = 5 and Numsect% = 3, 
  3673.       then this service will read sectors 5,6,an 7. 
  3674.  
  3675.  
  3676.       FLWSECT  - Write a sector 
  3677.  
  3678.       Usage - Call FlWSect(Numsect%, Databuf$, Sector%, Rc%) 
  3679.  
  3680.          Numsect%       Number of sectors to written 
  3681.  
  3682.          Databuf$       Data area containing the data to be written. 
  3683.  
  3684.          Sector%        Sector where write operation will start 
  3685.  
  3686.          Rc%            Return code 
  3687.  
  3688.                         Copyright (c) AJM Software 1987, 1991
  3689.                                 All Rights Reserved             Page 56
  3690.  
  3691.  
  3692.  
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.  
  3705.       Programming notes: 
  3706.  
  3707.       Sector% is the relative sector from the beginning of the disk, starting 
  3708.       with sector 0. 
  3709.  
  3710.       A return code of 0 indicates successful completion.  There are a large 
  3711.       number of return codes that can indicate failure.  These will not be docu 
  3712.       mented here - if you really need them, write and we will gladly send them 
  3713.       to you. 
  3714.  
  3715.       If you are writing more than one sector, the sectors will be written 
  3716.       sequentially starting at Sector%.  e.g. if Sector% = 5 and Numsect% = 3, 
  3717.       then this service will write sectors 5,6,an 7. 
  3718.  
  3719.       ************************** IMPORTANT *********************************** 
  3720.  
  3721.       Indiscriminate use of this function can cause serious problems with your 
  3722.       disk.  Accidentally writing over the boot sector or the FAT 
  3723.       can destroy all of the data on your disk.  TAKE A BACKUP before testing 
  3724.       this service, especially if you are writing to a HARD DISK. 
  3725.  
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.  
  3753.  
  3754.                         Copyright (c) AJM Software 1987, 1991
  3755.                                 All Rights Reserved             Page 57
  3756.  
  3757.  
  3758.  
  3759.  
  3760.  
  3761.  
  3762.  
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.  
  3769.  
  3770.                                DOS Replacement Services 
  3771.  
  3772.  
  3773.       Function Summary 
  3774.  
  3775.  
  3776.       FLFIND   - Find a file or group of files 
  3777.  
  3778.       FLCNT    - Count the number of matching files 
  3779.  
  3780.       FLMOVE   - Move a file 
  3781.  
  3782.       FLCOPY   - Copy a file to another file 
  3783.  
  3784.       FLSDRV   - Set the current drive 
  3785.  
  3786.       FLGDRV   - Get the current drive 
  3787.  
  3788.       FLCDIR   - Change the current directory 
  3789.  
  3790.       FLGDIR   - Get the current directory 
  3791.  
  3792.       FLMDIR   - Make a directory 
  3793.  
  3794.       FLDDIR   - Delete a directory 
  3795.  
  3796.       FLDSTAT  - Retrieve disk statistics 
  3797.  
  3798.  
  3799.  
  3800.  
  3801.  
  3802.  
  3803.  
  3804.  
  3805.  
  3806.  
  3807.  
  3808.  
  3809.  
  3810.  
  3811.  
  3812.  
  3813.  
  3814.  
  3815.  
  3816.  
  3817.  
  3818.  
  3819.  
  3820.                         Copyright (c) AJM Software 1987, 1991
  3821.                                 All Rights Reserved             Page 58
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833.  
  3834.  
  3835.  
  3836.       FLFIND   - Find a file or group of files 
  3837.  
  3838.       Usage - Call FlFind(FlSpec$, VARPTR(Dirlist$(0))) 
  3839.  
  3840.          FlSpec$        Standard ASCIIZ filename 
  3841.  
  3842.          Dirlist$(0)    Array containing all files matched by FlSpec$ 
  3843.  
  3844.  
  3845.       Programming notes: 
  3846.  
  3847.       FLFIND will return a list of all files in the current directory that match 
  3848.       FlSpec$.  Wildcards can be used. 
  3849.  
  3850.       Each entry in Dirlist$ must be initialized to 40 blanks.  If each element 
  3851.       is not properly initialized, a 'String Space Corrupt' error may occur. 
  3852.  
  3853.       Dirlist$ must be properly dimensioned so that all files matching FlSpec$ 
  3854.       can fit into the array.  If it is not properly dimensioned, unpredictable 
  3855.       results can occur (probably 'String Space Corrupt', but anything can hap 
  3856.       pen).  Use FLCNT to properly dimension the array. 
  3857.  
  3858.       FLFIND can be used to determine the presence or absence of a file. 
  3859.  
  3860.      See LOOK.BAS in  the sample programs for an  example of using FLCNT  and FLFIND.
  3861.      This program will  search an entire disk looking for matches (Wildcards are okay
  3862.      to use with LOOK.BAS). 
  3863.  
  3864.  
  3865.       FLCNT    - Count the number of matching files 
  3866.  
  3867.       Usage - Call(FlCnt(FlSpec$, Count%) 
  3868.  
  3869.          FlSpec$        Standard ASCIIZ filename 
  3870.  
  3871.          Count%         Number of files matching FlSpec$ 
  3872.  
  3873.  
  3874.       Programming notes: 
  3875.  
  3876.       FLCNT will return a count of all files in the current directory that match 
  3877.       FlSpec$.  Wildcards can be used. 
  3878.  
  3879.       FLCNT can be used to determine the presence or absence of file. 
  3880.  
  3881.       FLCNT should be used prior to calling FLFIND to ensure that the passed 
  3882.       array is large enough. 
  3883.  
  3884.       See LOOK.BAS in the sample programs (registered users only) for an example 
  3885.  
  3886.                         Copyright (c) AJM Software 1987, 1991
  3887.                                 All Rights Reserved             Page 59
  3888.  
  3889.  
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.  
  3899.  
  3900.  
  3901.       of using FLCNT and FLFIND.  This program will search an entire disk look 
  3902.       ing for matches (Wildcards are okay to use with LOOK.BAS). 
  3903.  
  3904.  
  3905.       FLMOVE   - Move a file 
  3906.  
  3907.       Usage - Call FlMove(Old.FlSpec$, New.FlSpec$, Rc%) 
  3908.  
  3909.          Old.FlSpec$    Standard ASCIIZ filename 
  3910.  
  3911.          New.FlSpec$    Standard ASCIIZ filename 
  3912.  
  3913.          Rc%            Return code 
  3914.  
  3915.  
  3916.       Programming notes: 
  3917.  
  3918.       New.FlSpec$ can be any valid DOS filename that is not currently in use. 
  3919.       You may specify a different directory, but you cannot move a file to a 
  3920.       different device. 
  3921.  
  3922.       Wildcards are not allowed. (A DOS wildcard is an '*' or a '?') 
  3923.  
  3924.       See Appendix D for an explanation of return codes. 
  3925.  
  3926.  
  3927.       FLCOPY   - Copy a file to another file 
  3928.  
  3929.       Usage - Call FlCopy(Old.Flspec$, New.Flspec$, Rc%) 
  3930.  
  3931.          Old.FlSpec$    Standard ASCIIZ filename 
  3932.  
  3933.          New.FlSpec$    Standard ASCIIZ filename 
  3934.  
  3935.          Rc%            Return code 
  3936.  
  3937.  
  3938.       Programming notes: 
  3939.  
  3940.       New.FlSpec$ must be a valid DOS filename.  If it already exists, it will 
  3941.       be overwritten. 
  3942.  
  3943.       This function is somewhat slower than the DOS copy command.  If a faster 
  3944.       copy is needed, modify the Assembly source code to provide a larger buf 
  3945.       fer (registered users only). 
  3946.  
  3947.       See Appendix D for an explanation of return codes. 
  3948.  
  3949.  
  3950.       FLSDRV   - Set the current drive 
  3951.  
  3952.                         Copyright (c) AJM Software 1987, 1991
  3953.                                 All Rights Reserved             Page 60
  3954.  
  3955.  
  3956.  
  3957.  
  3958.  
  3959.  
  3960.  
  3961.  
  3962.  
  3963.  
  3964.  
  3965.  
  3966.  
  3967.  
  3968.       Usage - Call FlSDrv(Drive$) 
  3969.  
  3970.          Drive$         Drive letter designation 
  3971.  
  3972.  
  3973.       Programming notes: 
  3974.  
  3975.       This service does not return a completion code.  It is up to the program 
  3976.       mer to insure that Drive$ is a valid drive designation (See FlGDrv to 
  3977.       determine the number of drives). 
  3978.  
  3979.  
  3980.       FLGDRV   - Get the current drive 
  3981.  
  3982.       Usage - Call FlGDrv(Drive$, Max.Drive$) 
  3983.  
  3984.          Drive$         Drive letter designation 
  3985.  
  3986.          Max.Drive$     Letter of the highest drive designation that Dos will 
  3987.                         recognize. 
  3988.  
  3989.  
  3990.       Programming notes: 
  3991.  
  3992.       Drive$ must be initialized to a single blank.  If it is not properly ini 
  3993.       tialized, this service will not function and a 'String Space Corrupt' 
  3994.       error may occur. 
  3995.  
  3996.       Max.Drive$ is the highest letter designation that DOS will recognize. DOS 
  3997.       assigns drive designators sequentially, so generally, if Max.Drive$ = 'D', 
  3998.       that should mean that drives A,B, and C are valid. 
  3999.  
  4000.       On some machines, Max.Drive$ may not be a valid drive.  It may be the 
  4001.       drive specified by the LASTDRIVE parameter of your CONFIG.SYS file.  For 
  4002.       consistent accurate results with this function, properly set LASTDRIVE in 
  4003.       your CONFIG.SYS file. 
  4004.  
  4005.  
  4006.       FLCDIR   - Change the current directory 
  4007.  
  4008.       Usage - Call FlCDir(Dir$, Rc%) 
  4009.  
  4010.          Dir$           Valid directory name (ASCIIZ string) 
  4011.  
  4012.          Rc%            Return code 
  4013.  
  4014.  
  4015.       Programming notes: 
  4016.  
  4017.  
  4018.                         Copyright (c) AJM Software 1987, 1991
  4019.                                 All Rights Reserved             Page 61
  4020.  
  4021.  
  4022.  
  4023.  
  4024.  
  4025.  
  4026.  
  4027.  
  4028.  
  4029.  
  4030.  
  4031.  
  4032.  
  4033.       See Appendix D for an explanation of return codes. 
  4034.  
  4035.       Dir$ must be a valid directory name preceded by a '\' and followed by 
  4036.       a Chr$(0) 
  4037.  
  4038.  
  4039.       FLGDIR   - Get the current directory 
  4040.  
  4041.       Usage - Call FlGDir(Dir$) 
  4042.  
  4043.          Dir$           Valid directory name (ASCIIZ string) 
  4044.  
  4045.  
  4046.       Programming notes: 
  4047.  
  4048.       Dir$ must be initialized to 64 blanks prior to calling FLGDIR.  If it is 
  4049.       not initialized properly, a 'String Space Corrupt' may result. 
  4050.  
  4051.       The current directory is returned in Dir$.  It is not preceded by a '\'. 
  4052.  
  4053.  
  4054.       FLMDIR   - Make a directory 
  4055.  
  4056.       Usage - Call FlMDir(Dir$, Rc%) 
  4057.  
  4058.          Dir$           Valid directory name (ASCIIZ string) 
  4059.  
  4060.          Rc%            Return code 
  4061.  
  4062.  
  4063.       Programming notes: 
  4064.  
  4065.       See Appendix D for an explanation of return codes. 
  4066.  
  4067.       Dir$ must be a valid directory name preceded by a '\' and followed by 
  4068.       a Chr$(0) 
  4069.  
  4070.  
  4071.       FLDDIR   - Delete a directory 
  4072.  
  4073.       Usage - Call FlDDir(Dir$, Rc%) 
  4074.  
  4075.          Dir$           Valid directory name (ASCIIZ string) 
  4076.  
  4077.          Rc%            Return code 
  4078.  
  4079.  
  4080.       Programming notes: 
  4081.  
  4082.       See Appendix D for an explanation of return codes. 
  4083.  
  4084.                         Copyright (c) AJM Software 1987, 1991
  4085.                                 All Rights Reserved             Page 62
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096.  
  4097.  
  4098.  
  4099.  
  4100.       Dir$ must be a valid directory name preceded by a '\' and followed by 
  4101.       a Chr$(0) 
  4102.  
  4103.  
  4104.       FLDSTAT  - Retrieve disk statistics 
  4105.  
  4106.       Usage - Call FlDStat(Drive$, Type%, Bytes.Sector%, Sector.Cluster%, _ 
  4107.                            Avail.Cluster%, Total.Cluster%, Rc%) 
  4108.  
  4109.          Drive$           Valid letter drive designation 
  4110.  
  4111.          Type%            Type of drive 
  4112.  
  4113.          Bytes.Sector%    Number of bytes in a sector on the target disk 
  4114.  
  4115.          Sector.Cluster%  Number of sectors in a cluster on the target disk 
  4116.  
  4117.          Avail.Cluster%   Number of unused clusters on the target drive 
  4118.  
  4119.          Total.Cluster%   Number of clusters on the target drive 
  4120.  
  4121.          Rc%              Return code 
  4122.  
  4123.  
  4124.       Programming notes: 
  4125.  
  4126.       See Appendix D for an explanation of return codes. 
  4127.  
  4128.       Type% will indicate the type of drive.  Possible values are: 
  4129.  
  4130.          255  -  DSDD   8 Sectors/Track 
  4131.          254  -  SSDD   8 Sectors/Track 
  4132.          253  -  DSDD   9 Sectors/Track 
  4133.          252  -  SSDD   8 Sectors/Track 
  4134.          249  -  HD    15 Sectors/Track 
  4135.          248  -  Fixed disk 
  4136.  
  4137.       Most RAM drives will appear to be a fixed disk. 
  4138.  
  4139.       Available space on the disk can be computed by the formula: 
  4140.          Bytes.Sector% * Sector.Cluster% * Avail.Cluster% 
  4141.  
  4142.       Total space on the disk can be computed by the formula: 
  4143.          Bytes.Sector% * Sector.Cluster% * Total.Cluster% 
  4144.  
  4145.  
  4146.  
  4147.  
  4148.  
  4149.  
  4150.                         Copyright (c) AJM Software 1987, 1991
  4151.                                 All Rights Reserved             Page 63
  4152.  
  4153.  
  4154.  
  4155.  
  4156.  
  4157.  
  4158.  
  4159.  
  4160.  
  4161.  
  4162.  
  4163.  
  4164.  
  4165.  
  4166.                              Miscellaneous DOS Services 
  4167.  
  4168.  
  4169.      Function Summary 
  4170.  
  4171.  
  4172.      BOOT     - Initiate a cold or warm boot 
  4173.  
  4174.      DOSEXIT  - Terminate with a return code
  4175.  
  4176.      DOSEXEC  - SHELL replacement
  4177.  
  4178.      DOSCHOUT - Write a string to the standard output device 
  4179.  
  4180.      DOSCHRIN - Read a character from the standard input device 
  4181.  
  4182.      DOSSTRIN - Read a string from the standard input device 
  4183.  
  4184.      DOSRED   - Redirect a DOS standard handle 
  4185.  
  4186.      DOSPRSC  - Print the screen 
  4187.  
  4188.      DOSVER   - Get the DOS version 
  4189.  
  4190.      DOSVRFY  - Turn verify mode on and off 
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209.  
  4210.  
  4211.  
  4212.  
  4213.  
  4214.  
  4215.  
  4216.                         Copyright (c) AJM Software 1987, 1991
  4217.                                 All Rights Reserved             Page 64
  4218.  
  4219.  
  4220.  
  4221.  
  4222.  
  4223.  
  4224.  
  4225.  
  4226.  
  4227.  
  4228.  
  4229.  
  4230.  
  4231.  
  4232.       BOOT    - Initiate a cold or warm boot 
  4233.  
  4234.       Usage - Call Boot(Function%) 
  4235.  
  4236.          Function%      0 - Perform a warm boot 
  4237.                         1 - perform a cold boot 
  4238.  
  4239.  
  4240.       Programming notes: 
  4241.  
  4242.       There is no return from this function - it restarts the machine. 
  4243.  
  4244.       A warm boot is the equivalent of pressing Alt-Ctrl-Del - a cold boot is 
  4245.       the equivalent of turning the machine off and then on again. 
  4246.   
  4247.  
  4248.      DOSEXIT - Terminate with a return code
  4249.  
  4250.      Usage - Call DosExit(Rc%)
  4251.  
  4252.      Programming notes:
  4253.  
  4254.      This function can be used to terminate a program with a return code.  The return
  4255.      code can then  be used in an ERRORLEVEL  statement in a batch file.   The return
  4256.      code must be in the range 0-255.  DO NOT USE THIS FUNCTION WITHIN THE QUICKBASIC
  4257.      DEVELOPMENT ENVIRONMENT.  IT WILL TERMINATE QUICKBASIC.  
  4258.  
  4259.  
  4260.      DOSEXEC  - SHELL replacement
  4261.  
  4262.      Usage - Call DosExec(ProgName$, EnvBlock$, CmdTail$, Rc%, PRc%, TermTyp%)
  4263.  
  4264.           ProgName$      The fully  qualified name  of the program  or batch  file to
  4265.                          execute.  (i.e. - ProgName$ = "c:\dos\edlin.exe")
  4266.  
  4267.           EnvBlock$      Environment block to be used by the sub-process.
  4268.  
  4269.           CmdTail$       COMMAND line argument
  4270.  
  4271.           Rc%            Function return code
  4272.                               0  - Successful
  4273.                               1  - Invalid function
  4274.                               2  - Insufficient memory
  4275.                               5  - Access denied
  4276.                               10 - Invalid environment
  4277.                               11 - Invalid format
  4278.  
  4279.           PRc%           Program return code (0-255)
  4280.  
  4281.  
  4282.                         Copyright (c) AJM Software 1987, 1991
  4283.                                 All Rights Reserved             Page 65
  4284.  
  4285.  
  4286.  
  4287.  
  4288.  
  4289.  
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297.           TermTyp%       Termination method
  4298.                               0 - Normal termination
  4299.                               1 - Terminated with Ctrl-C
  4300.                               2 - Terminated with Critical error
  4301.                               3 - Loaded as TSR
  4302.  
  4303.      Programming notes:
  4304.  
  4305.      Set  EnvBlock$ =  "" to use  the default  environment.  If  you set  up your own
  4306.      environment,  be  sure  to include  the  COMSPEC  variable.   Each  line  in the
  4307.      environment must terminate with CHR$(0).  See the sample program included in the
  4308.      registered version.
  4309.  
  4310.      If TermTyp% equals 3 upon return, the sub-process has loaded itself as a TSR and
  4311.      Quickbasic probably will not run.
  4312.  
  4313.  
  4314.       DOSCHOUT - Write a string to the standard output device 
  4315.  
  4316.       Usage - Call DosChOut(Str.Out$) 
  4317.  
  4318.          Str.Out$       Text to be written 
  4319.  
  4320.  
  4321.       Programming notes: 
  4322.  
  4323.       If the standard output device is CON (monitor), the text is written to the 
  4324.       current cursor location. 
  4325.  
  4326.       Printing control characters(i.e. carriage return, line feeds) will cause 
  4327.       the cursor to move accordingly. 
  4328.  
  4329.       All data is written in 'raw' mode - this bypasses certain checking that 
  4330.       DOS normally would do and increases output speed a little. 
  4331.  
  4332.       Do not print chr$(255) as this will cause a keyboard read to occur. 
  4333.       This service, like the other DOS keyboard/con services, can be 
  4334.       re-directed. 
  4335.  
  4336.  
  4337.  
  4338.       DOSCHRIN - Read a character from the standard input device 
  4339.  
  4340.       Usage - Call DosChrIn(Char.In$, Echo%, Rc%) 
  4341.  
  4342.          Char.In$       Character returned from the standard input device. 
  4343.  
  4344.          Echo%          0 - do not echo to standard output 
  4345.                         1 - echo to standard output 
  4346.  
  4347.  
  4348.                         Copyright (c) AJM Software 1987, 1991
  4349.                                 All Rights Reserved             Page 66
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.  
  4362.  
  4363.          Rc%            0 - indicates no character was found 
  4364.                         1 - indicates character returned in Char.In$ 
  4365.                         2 - indicates an extended ASCII character was returned 
  4366.                             in Char.In$ 
  4367.  
  4368.  
  4369.       Programming notes: 
  4370.  
  4371.       Extended ASCII characters will not echo. 
  4372.  
  4373.       No special action is taken if Ctrl-C or Ctrl-Break is detected. 
  4374.  
  4375.       Char.In$ must be initialized to a space.  If it is not, the service will 
  4376.       fail and a "String Space Corrupt' condition may occur. 
  4377.  
  4378.       If an extended ASCII code is entered, Char.In$ will contain the second 
  4379.       character of the code. 
  4380.  
  4381.       This service, like the other DOS keyboard/con services, can be 
  4382.       re-directed. 
  4383.  
  4384.  
  4385.       DOSSTRIN - Read a string from the standard input device 
  4386.  
  4387.       Usage - Call DosStrIn(Text.In$, Count%) 
  4388.  
  4389.          Text.In$       input string 
  4390.  
  4391.          Count%         length of input string 
  4392.  
  4393.  
  4394.       Programming notes: 
  4395.  
  4396.       Use this function only for input of a single string on a screen.  The 
  4397.       editing characteristics of this service do not lend themselves to full 
  4398.       screen input. 
  4399.  
  4400.       No extended ASCII codes are allowed by this function. 
  4401.  
  4402.       The maximum input length is the length of Text.In$ - 3.  For example, if 
  4403.       you wanted input with a maximum length of 12 characters, use the following 
  4404.       code: 
  4405.  
  4406.                         Text.In$ = Space$(15)  'Maximum length + 3 
  4407.                         call DosStrIn(Text.In$, Count%) 
  4408.  
  4409.       End of input is signaled by pressing the [Enter] key. 
  4410.  
  4411.       If you type in more than the maximum number of characters, the beep will 
  4412.       sound until [Enter] is pressed. 
  4413.  
  4414.                         Copyright (c) AJM Software 1987, 1991
  4415.                                 All Rights Reserved             Page 67
  4416.  
  4417.  
  4418.  
  4419.  
  4420.  
  4421.  
  4422.  
  4423.  
  4424.  
  4425.  
  4426.  
  4427.  
  4428.  
  4429.  
  4430.       No cursor will be displayed while characters are being entered. 
  4431.  
  4432.       The characters entered at the keyboard will echo on the monitor at the 
  4433.       current cursor position. 
  4434.  
  4435.       This service, like the other DOS keyboard/con services, can be 
  4436.       re-directed. 
  4437.   
  4438.       DOSRED   - Redirect a DOS standard handle 
  4439.  
  4440.       Usage - Call DosRed(Device%, FileSpec$, Rc%) 
  4441.  
  4442.          Device%        Device to redirect 
  4443.                         0 - Standard input 
  4444.                         1 - Standard output 
  4445.                         3 - Standard AUX device 
  4446.                         4 - Standard list device 
  4447.  
  4448.          Filespec$      Standard ASCIIZ string 
  4449.  
  4450.          Rc%            Return code 
  4451.  
  4452.  
  4453.       Programming notes: 
  4454.  
  4455.       See the Appendix D for an explanation of return codes. 
  4456.  
  4457.       The standard input device is CON, or the keyboard.  If you redirect this 
  4458.       device to accept from a file, you cannot detect end-of-file.  If you play 
  4459.       with this device, be prepared to reboot quite a bit while testing - incor 
  4460.       rect handling can easily cause the keyboard to lock up. 
  4461.  
  4462.       The standard output device is CON, or the monitor.  You can redirect this 
  4463.       device either to a file or printer.  Once redirected, all PRINT statements 
  4464.       will print to FileSpec$.  See the sample program TYPER.BAS included with 
  4465.       this package. 
  4466.  
  4467.       The standard auxiliary device is AUX - generally COM1. 
  4468.  
  4469.       The standard list device is PRN - generally LPT1.  Unfortunately, Basic 
  4470.       does not use the standard list device for LPRINT statements or for 
  4471.       PRINT# statements, thereby making redirection of this handle a little less 
  4472.       useful than it could be. 
  4473.  
  4474.       If FileSpec$ is NUL (i.e. FileSpec$ = ""), DOSRED will reset the device to 
  4475.       its default value. these are: 
  4476.  
  4477.               Device%          Default 
  4478.                 0                CON 
  4479.  
  4480.                         Copyright (c) AJM Software 1987, 1991
  4481.                                 All Rights Reserved             Page 68
  4482.  
  4483.  
  4484.  
  4485.  
  4486.  
  4487.  
  4488.  
  4489.  
  4490.  
  4491.  
  4492.  
  4493.  
  4494.  
  4495.                 1                CON 
  4496.                 3                AUX 
  4497.                 4                PRN 
  4498.  
  4499.       If FIleSpec$ is CHR$(255), DOSRED will simply close that handle.  This is 
  4500.       useful if you're not using DOS 3.3 and you need more than fifteen files 
  4501.       open at one time (the Quickbasic limit).  Simply close one of the devices, 
  4502.       and that allows you to open another file.  If you close the standard input 
  4503.       device, be sure to reopen it as you won't be able to get any input from 
  4504.       the keyboard.  Rumor has it that under DOS 3.3, you can have up to 255 
  4505.       files open at any one time. 
  4506.  
  4507.       If FileSpec$ is a disk file, and it already exists, DOSRED will simply 
  4508.       write over it.  If it does not exist, DOSRED will create it.  You must 
  4509.       close any disk files used for redirection before terminating your program. 
  4510.       Otherwise, the file's directory entry (length) will not be updated and you 
  4511.       will not be able to process that file.  A file close is done automatically 
  4512.       when you issue a reset (FileSpec$ = ""). 
  4513.  
  4514.  
  4515.       DOSPRSC  - Print the screen 
  4516.  
  4517.       Call DosPrSc 
  4518.  
  4519.  
  4520.       Programming notes: 
  4521.  
  4522.       This service will print the contents of the screen buffer.  It is really a 
  4523.       BIOS service, but because of it's usefulness, it is included here. 
  4524.  
  4525.  
  4526.       DOSVER   - Get the DOS version 
  4527.  
  4528.  
  4529.       Usage - Call DosVer(Version%) 
  4530.  
  4531.          Version%       the version of DOS currently running 
  4532.  
  4533.  
  4534.       Programming notes: 
  4535.  
  4536.       Version is returned as an integer.  DOS 3.10 would be returned as 310, and 
  4537.       so on.  To display it properly, use the following code: 
  4538.  
  4539.  
  4540.          Call DosVer(Version%) 
  4541.          Print Using "#.##";Version%/100 
  4542.  
  4543.  
  4544.       DOSVRFY  - Turn verify mode on and off 
  4545.  
  4546.                         Copyright (c) AJM Software 1987, 1991
  4547.                                 All Rights Reserved             Page 69
  4548.  
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555.  
  4556.  
  4557.  
  4558.  
  4559.  
  4560.  
  4561.  
  4562.       Usage - Call DosVrfy(Function%) 
  4563.  
  4564.          Function%      0 - turn verify off 
  4565.                         1 - turn verify on 
  4566.                        -1 - get status of verify 
  4567.  
  4568.  
  4569.       Programming notes: 
  4570.  
  4571.       When verify is on, every write request made through DOS will cause DOS to 
  4572.       reread the sector just written to insure that it is readable. 
  4573.  
  4574.       No verification is done when BIOS is used to write a sector. 
  4575.  
  4576.       DOS does NOT perform a verify by checking that the sector written matches 
  4577.       the data in the output buffer.  It simply insures that the sector written 
  4578.       can be read and that it passes the CRC. 
  4579.  
  4580.       Verify does add overhead when it is turned on.  Use this service when the 
  4581.       output media is questionable. 
  4582.  
  4583.       When using Function% = -1, DOSVRFY will return a 0 in Function% if Verify 
  4584.       is off and a 1 if Verify is on. 
  4585.  
  4586.  
  4587.  
  4588.  
  4589.  
  4590.  
  4591.  
  4592.  
  4593.  
  4594.  
  4595.  
  4596.  
  4597.  
  4598.  
  4599.  
  4600.  
  4601.  
  4602.  
  4603.  
  4604.  
  4605.  
  4606.  
  4607.  
  4608.  
  4609.  
  4610.  
  4611.  
  4612.                         Copyright (c) AJM Software 1987, 1991
  4613.                                 All Rights Reserved             Page 70
  4614.  
  4615.  
  4616.  
  4617.  
  4618.  
  4619.  
  4620.  
  4621.  
  4622.  
  4623.  
  4624.  
  4625.  
  4626.  
  4627.  
  4628.                                   The Print Spooler 
  4629.  
  4630.  
  4631.                YOU MUST HAVE VERSION 3.XX OF DOS TO USE THESE SERVICES 
  4632.  
  4633.  
  4634.       Function Summary 
  4635.  
  4636.  
  4637.       DOSPSTAT - Request spooler status 
  4638.  
  4639.       DOSPCAN  - Cancel all spooled files 
  4640.  
  4641.       DOSPDEL  - Delete a file from the queue 
  4642.  
  4643.       DOSPLST  - List all files in the queue 
  4644.  
  4645.       DOSPSUB  - Submit a file to the queue 
  4646.  
  4647.  
  4648.  
  4649.  
  4650.  
  4651.  
  4652.  
  4653.  
  4654.  
  4655.  
  4656.  
  4657.  
  4658.  
  4659.  
  4660.  
  4661.  
  4662.  
  4663.  
  4664.  
  4665.  
  4666.  
  4667.  
  4668.  
  4669.  
  4670.  
  4671.  
  4672.  
  4673.  
  4674.  
  4675.  
  4676.  
  4677.  
  4678.                         Copyright (c) AJM Software 1987, 1991
  4679.                                 All Rights Reserved             Page 71
  4680.  
  4681.  
  4682.  
  4683.  
  4684.  
  4685.  
  4686.  
  4687.  
  4688.  
  4689.  
  4690.  
  4691.  
  4692.  
  4693.  
  4694.       DOSPSTAT - Request spooler status 
  4695.  
  4696.       Usage - Call DosPStat(Rc%) 
  4697.  
  4698.          Rc%            0 - Normal status - okay to use spooler 
  4699.                         1 - Spooler is inactive 
  4700.                         2 - Spooler unavailable 
  4701.                       255 - Invalid request (invalid DOS version) 
  4702.  
  4703.  
  4704.       Programming notes: 
  4705.  
  4706.       This service simply provides the spooler status.  Each service in this 
  4707.       section also checks the spooler status. 
  4708.  
  4709.       The only good return code is 0.  Any of the other return codes indicate 
  4710.       that the spooler is not useable. 
  4711.  
  4712.       A return code of 1 indicates the spooler is not running, but it could 
  4713.       be started from the DOS prompt. 
  4714.  
  4715.       A return code of 2 indicates that the spooler is not active and it cannot 
  4716.       be started because some other process has captured the spooler interrupt. 
  4717.  
  4718.       A return code of 255 indicates that the wrong version of DOS is installed 
  4719.       - version 3.00 or higher is needed. 
  4720.  
  4721.       See Appendix E for a discussion on starting the print spooler. 
  4722.  
  4723.   
  4724.       DOSPCAN  - Cancel all spooled files 
  4725.  
  4726.       Usage - Call DosPCan(Rc%) 
  4727.  
  4728.          Rc%            Return code 
  4729.  
  4730.  
  4731.       Programming notes: 
  4732.  
  4733.       See Appendix E for an explanation of return codes. 
  4734.  
  4735.       This service will delete all files from the print queue.  Please remember 
  4736.       that most printers have a print buffer - some as large as 256k.  This 
  4737.       function will not clear the print buffer. 
  4738.  
  4739.  
  4740.       DOSPDEL  - Delete a file from the queue 
  4741.  
  4742.       Usage - Call DosPDel(FileSpec$, Rc%) 
  4743.  
  4744.                         Copyright (c) AJM Software 1987, 1991
  4745.                                 All Rights Reserved             Page 72
  4746.  
  4747.  
  4748.  
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754.  
  4755.  
  4756.  
  4757.  
  4758.  
  4759.  
  4760.          Filespec$             ASCIIZ string 
  4761.  
  4762.          Rc%                   Return code 
  4763.  
  4764.  
  4765.       Programming notes: 
  4766.  
  4767.       Filespec$ should be the name of a file in the print queue in ASCIIZ for 
  4768.       mat.  ASCIIZ format is simply the file name followed by a CHR$(0), for 
  4769.       example: 
  4770.  
  4771.               Filespec$  = "C:\SPOOLDIR\TEXTFILE.DAT" +CHR$(0) 
  4772.  
  4773.       You must use the entire filename (including drive and path) when deleting 
  4774.       a file from the queue. 
  4775.  
  4776.       See Appendix E for an explanation of return codes. 
  4777.  
  4778.       This service will delete a files from the print queue.  Please remember 
  4779.       that most printers have a print buffer - some as large as 256k.  This 
  4780.       function will not clear the print buffer, so if the deleted file is print 
  4781.       ing, it will continue to print until the buffer is emptied. 
  4782.  
  4783.  
  4784.       DOSPLST  - List all files in the queue 
  4785.  
  4786.       Usage - Call DosPLst(File.Array$(0), Rc%) 
  4787.  
  4788.          File.Array$           Array that will contain the names of all the 
  4789.                                files in the print queue 
  4790.  
  4791.          Rc%                   Return code 
  4792.  
  4793.  
  4794.       Programming notes: 
  4795.  
  4796.       See Appendix E for a explanation of return codes. 
  4797.  
  4798.       File.Array$ must be initialized and have the proper number of elements 
  4799.       prior to calling DOSPLST.  Failing to initialize it properly will cause 
  4800.       DOSPLST to fail and probably freeze up your computer. 
  4801.  
  4802.       The maximum number of entries depends on what parameters were used when 
  4803.       the print spooler was started.  The absolute maximum is 32.  I would 
  4804.       strongly recommend that you plan for the maximum.  The following code seg 
  4805.       ment shows the proper method of using DOSPLST. 
  4806.  
  4807.               MaxQueue%  = 31                   'This is really 32 entries when 
  4808.                                                 'using Option Base 0 
  4809.  
  4810.                         Copyright (c) AJM Software 1987, 1991
  4811.                                 All Rights Reserved             Page 73
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817.  
  4818.  
  4819.  
  4820.  
  4821.  
  4822.  
  4823.  
  4824.  
  4825.               Dim File.Array$(MaxQueue%)        'plan for max number of entries 
  4826.  
  4827.               For X% = 0 to MaxQueue%           'initialize the array 
  4828.                         File.Array$ = Space$(64) 'max length of a filename 
  4829.               Next 
  4830.  
  4831.               Call DosPLst(File.Array$(0), Rc%) 'go get list 
  4832.  
  4833.               If Rc% <> 0 then goto YOUR.ERROR.ROUTINE 
  4834.  
  4835.  
  4836.       DOSPSUB  - Submit a file to the queue 
  4837.  
  4838.  
  4839.       Usage - Call DosPSub(FileSpec$, Rc%) 
  4840.  
  4841.          FileSpec$             ASCIIZ string 
  4842.  
  4843.          Rc%                   Return code 
  4844.  
  4845.  
  4846.       Programming notes: 
  4847.  
  4848.       FileSpec$ is the name of the file to be submitted to the print queue. 
  4849.  
  4850.       See Appendix E for an explanation of return codes. 
  4851.  
  4852.       The file is placed at the tail of the print queue.  It will not print 
  4853.       until all other files ahead of it have already printed.  There is no way 
  4854.       of prioritizing the files with the services presented here. 
  4855.  
  4856.  
  4857.  
  4858.  
  4859.  
  4860.  
  4861.  
  4862.  
  4863.  
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869.  
  4870.  
  4871.  
  4872.  
  4873.  
  4874.  
  4875.  
  4876.                         Copyright (c) AJM Software 1987, 1991
  4877.                                 All Rights Reserved             Page 74
  4878.  
  4879.  
  4880.  
  4881.  
  4882.  
  4883.  
  4884.  
  4885.  
  4886.  
  4887.  
  4888.  
  4889.  
  4890.  
  4891.                                     String Functions 
  4892.  
  4893.  
  4894.       Function Summary 
  4895.  
  4896.  
  4897.       VERIFY   - Verify all characters in a string 
  4898.  
  4899.       XVERIFY  - Slightly different twist on VERIFY 
  4900.  
  4901.       CHARXLAT - Replace multiple characters in a string 
  4902.  
  4903.       TRANSLAT - Replace all occurrences of a character in a string 
  4904.  
  4905.       COMPRESS - Remove leading and trailing blanks 
  4906.  
  4907.       UPCASE   - Convert all characters in a string to upper case 
  4908.  
  4909.       LOCASE   - Convert all characters in a string to lower case 
  4910.  
  4911.       PROPER   - Convert a string to a proper name 
  4912.  
  4913.       HEXSTR   - Convert a string to its hexadecimal equivalent 
  4914.  
  4915.  
  4916.  
  4917.  
  4918.  
  4919.  
  4920.  
  4921.  
  4922.  
  4923.  
  4924.  
  4925.  
  4926.  
  4927.  
  4928.  
  4929.  
  4930.  
  4931.  
  4932.  
  4933.  
  4934.  
  4935.  
  4936.  
  4937.  
  4938.  
  4939.  
  4940.  
  4941.  
  4942.                         Copyright (c) AJM Software 1987, 1991
  4943.                                 All Rights Reserved             Page 75
  4944.  
  4945.  
  4946.  
  4947.  
  4948.  
  4949.  
  4950.  
  4951.  
  4952.  
  4953.  
  4954.  
  4955.  
  4956.  
  4957.  
  4958.       VERIFY  - Verify all characters in a string 
  4959.  
  4960.       Usage Call Verify(Target$, Mask$, Rc%) 
  4961.  
  4962.          Target$        String to be verified 
  4963.  
  4964.          Mask$          String of characters to be verified in Target$ 
  4965.  
  4966.          Rc%            Return code - 0 if all characters in Target$ are 
  4967.                         contained in Mask$, otherwise, the position of the 
  4968.                         first character in Target$ that is not contained in 
  4969.                         Mask$ 
  4970.  
  4971.  
  4972.       Programming notes: 
  4973.  
  4974.       Identical to the PL/I Verify function.  It is useful for validating 
  4975.       a field for all character or all numeric. 
  4976.  
  4977.       For example: 
  4978.  
  4979.          Find the first non-blank character in Target$ 
  4980.  
  4981.               Call Verify (Target$, Space$(1), Rc%) 
  4982.               NonBlank$ = Mid$(Target$, Rc%,1) 
  4983.  
  4984.          Determine if Target$ is all numeric 
  4985.  
  4986.               Call Verify (Target$, "0123456789", Rc%) 
  4987.               If Rc% = 0 then 
  4988.                         GoTo Target.Numeric 
  4989.               Else 
  4990.                         GoTo Target.NonNumeric 
  4991.               End if 
  4992.  
  4993.  
  4994.       XVERIFY  - Slightly different twist on VERIFY 
  4995.  
  4996.  
  4997.       Usage Call XVerify(Target$, Mask$, Rc%) 
  4998.  
  4999.          Target$        String to be verified 
  5000.  
  5001.          Mask$          String of characters to be verified in Target$ 
  5002.  
  5003.          Rc%            Return code - 0 if all characters in Target$ are 
  5004.                         contained in Mask$, otherwise, the position of the 
  5005.                         last character in Target$ that is not contained in 
  5006.                         Mask$ 
  5007.  
  5008.                         Copyright (c) AJM Software 1987, 1991
  5009.                                 All Rights Reserved             Page 76
  5010.  
  5011.  
  5012.  
  5013.  
  5014.  
  5015.  
  5016.  
  5017.  
  5018.  
  5019.  
  5020.  
  5021.  
  5022.  
  5023.  
  5024.  
  5025.       Programming notes: 
  5026.  
  5027.       Identical to the PL/I Verify function.  It is useful for validating 
  5028.       a field for all character or all numeric. 
  5029.  
  5030.       For example: 
  5031.  
  5032.          Find the first non-blank character in Target$ 
  5033.  
  5034.               Call XVerify (Target$, Space$(1), Rc%) 
  5035.               NonBlank$ = Mid$(Target$, Rc%,1) 
  5036.  
  5037.          Determine if Target$ is all numeric 
  5038.  
  5039.               Call XVerify (Target$, "0123456789", Rc%) 
  5040.               If Rc% = 0 then 
  5041.                         GoTo Target.Numeric 
  5042.               Else 
  5043.                         GoTo Target.NonNumeric 
  5044.               End if 
  5045.  
  5046.  
  5047.       ***** REMEMBER, VERIFY RETURNS THE POSITION OF THE FIRST CHARACTER ***** 
  5048.       ***** IN TARGET$ THAT IS NOT FOUND IN MASK$ - XVERIFY RETURNS THE  ***** 
  5049.       ***** POSITION OF THE LAST CHARACTER. 
  5050.  
  5051.   
  5052.       CHARXLAT - Replace multiple characters in a string 
  5053.  
  5054.  
  5055.       Usage Call CharXlat(Str1$, TrTable$) 
  5056.  
  5057.          Str1$          String to be translated 
  5058.  
  5059.          TrTable$       256 Byte translate table 
  5060.  
  5061.  
  5062.       Programming notes: 
  5063.  
  5064.       This function will take each character in Str1$ and change it to a 
  5065.       corresponding value specified in TrTable$.  For example, the character 
  5066.       '1' has an ASCII value of 31.  This function will replace every 
  5067.       occurrence of the character '1' in Str1$ with whatever is in the 31st 
  5068.       byte of TrTable$. 
  5069.  
  5070.       For example, the following code segment (taken from DUMP.BAS in the 
  5071.       sample program archive) will change all non-displayable characters in 
  5072.       a string into a .(period). 
  5073.  
  5074.                         Copyright (c) AJM Software 1987, 1991
  5075.                                 All Rights Reserved             Page 77
  5076.  
  5077.  
  5078.  
  5079.  
  5080.  
  5081.  
  5082.  
  5083.  
  5084.  
  5085.  
  5086.  
  5087.  
  5088.  
  5089.  
  5090.               TrTable$ = String$(256,".") 
  5091.               For x% = 31 to 126 
  5092.                         MID$(TrTable$, x% + 1, 1) = CHR$(x%) 
  5093.               NEXT 
  5094.  
  5095.               Call CharXlat(Str1$, TrTable$) 
  5096.  
  5097.       Str1$ can now be safely be displayed on a screen. 
  5098.  
  5099.  
  5100.       TRANSLAT - Replace all occurrences of a character in a string 
  5101.  
  5102.       Usage Call Translat(Str1$, Target$, Repl$) 
  5103.  
  5104.          Str1$          String to be translated 
  5105.  
  5106.          Target$        Character to be replaced 
  5107.  
  5108.          Repl$          Replacement character 
  5109.  
  5110.  
  5111.       Programming notes: 
  5112.  
  5113.       This function will replace each occurrence of Target$ in Str1$ and 
  5114.       replace it with Repl$. 
  5115.  
  5116.       For example: 
  5117.  
  5118.               Str1$ = "aabbcc" 
  5119.               Target$ = "b" 
  5120.               Repl$   = "x" 
  5121.  
  5122.               Call Translat(Str1$, Target$, Repl$) 
  5123.  
  5124.               Print Str1$ 
  5125.  
  5126.       would display the string "aaxxcc". 
  5127.  
  5128.  
  5129.       COMPRESS - Remove leading and trailing blanks 
  5130.  
  5131.       Usage - Rem $Include: 'compress.fn' 
  5132.               Str1$ = FnCompress$(Str2$) 
  5133.  
  5134.          Str1$                 Any string 
  5135.  
  5136.          Str2$                 Str1$ with leading and trailing blanks 
  5137.                                removed 
  5138.  
  5139.  
  5140.                         Copyright (c) AJM Software 1987, 1991
  5141.                                 All Rights Reserved             Page 78
  5142.  
  5143.  
  5144.  
  5145.  
  5146.  
  5147.  
  5148.  
  5149.  
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.  
  5156.       Programming notes: 
  5157.  
  5158.       QB V4.0 also provides a similar function.  This one is a little 
  5159.       faster. 
  5160.  
  5161.  
  5162.       UPCASE - Convert all characters in a string to upper case 
  5163.  
  5164.  
  5165.       Usage - Call UpCase(Str1$) 
  5166.  
  5167.          Str1$                 any string 
  5168.  
  5169.  
  5170.  
  5171.       Programming notes: 
  5172.  
  5173.       This function became available with QB V4.0.  UPCASE is a little 
  5174.       faster. 
  5175.  
  5176.  
  5177.       LOCASE - Convert all characters in a string to lower case 
  5178.  
  5179.  
  5180.  
  5181.       Usage - Call LoCase(Str1$) 
  5182.  
  5183.          Str1$                 any string 
  5184.  
  5185.  
  5186.  
  5187.       Programming notes: 
  5188.  
  5189.       This function became available with QB V4.0.  LOCASE is a little 
  5190.       faster. 
  5191.  
  5192.  
  5193.       PROPER - Convert a string to a proper name 
  5194.  
  5195.       Usage - Call Proper(Str1$) 
  5196.  
  5197.          Str1$                 any string 
  5198.  
  5199.  
  5200.  
  5201.       Programming notes: 
  5202.  
  5203.       Proper works by making the first letter of each word upper case and 
  5204.       making all subsequent letters lower case. 
  5205.  
  5206.                         Copyright (c) AJM Software 1987, 1991
  5207.                                 All Rights Reserved             Page 79
  5208.  
  5209.  
  5210.  
  5211.  
  5212.  
  5213.  
  5214.  
  5215.  
  5216.  
  5217.  
  5218.  
  5219.  
  5220.  
  5221.  
  5222.  
  5223.       HEXSTR - Convert a string to its hexadecimal equivalent 
  5224.  
  5225.       Usage - Call HexStr(Str1$, Str2$) 
  5226.  
  5227.          Str1$                 any string 
  5228.  
  5229.          Str2$                 A string initialized to spaces.  Its' length 
  5230.                                must be at least twice that of Str1$. 
  5231.  
  5232.  
  5233.       Programming notes: 
  5234.  
  5235.       This function returns the hexadecimal equivalent of Str1$ in Str2$.  For 
  5236.       example: 
  5237.  
  5238.               Str1$ = "123" 
  5239.               Str2$ = Space$(2*LEN(Str1$)) 
  5240.  
  5241.               Call HexStr(Str1$, Str2$) 
  5242.               Print Str2$ 
  5243.  
  5244.       would display '313233' on your screen.  See DUMP.BAS in the sample program 
  5245.       archive for an example. 
  5246.  
  5247.  
  5248.  
  5249.  
  5250.  
  5251.  
  5252.  
  5253.  
  5254.  
  5255.  
  5256.  
  5257.  
  5258.  
  5259.  
  5260.  
  5261.  
  5262.  
  5263.  
  5264.  
  5265.  
  5266.  
  5267.  
  5268.  
  5269.  
  5270.  
  5271.  
  5272.                         Copyright (c) AJM Software 1987, 1991
  5273.                                 All Rights Reserved             Page 80
  5274.  
  5275.  
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.  
  5285.  
  5286.  
  5287.  
  5288.                                  Date/Time Functions 
  5289.  
  5290.  
  5291.  
  5292.       Function Summary 
  5293.  
  5294.  
  5295.  
  5296.       DATEPACK - Pack a date into two bytes 
  5297.  
  5298.       DATEUNPK - Unpack a date packed with DATEPACK 
  5299.  
  5300.       GREGTJUL - Convert a date from Gregorian to Julian format 
  5301.  
  5302.       JULTGREG - Convert a date from Julian to Gregorian format 
  5303.  
  5304.       DAYSDIFF - Compute the number of days between two dates 
  5305.  
  5306.       WEEKDAY  - Determine the day of the week 
  5307.  
  5308.       CALENDAR - Pop-up a calendar anywhere on the screen 
  5309.  
  5310.       ADDTIME  - Add two times together 
  5311.  
  5312.       SUBTIME  - Subtract two times 
  5313.  
  5314.       TIME     - Timer services 
  5315.       TICKS 
  5316.       BSGETIME 
  5317.  
  5318.  
  5319.  
  5320.  
  5321.  
  5322.  
  5323.  
  5324.  
  5325.  
  5326.  
  5327.  
  5328.  
  5329.  
  5330.  
  5331.  
  5332.  
  5333.  
  5334.  
  5335.  
  5336.  
  5337.  
  5338.                         Copyright (c) AJM Software 1987, 1991
  5339.                                 All Rights Reserved             Page 81
  5340.  
  5341.  
  5342.  
  5343.  
  5344.  
  5345.  
  5346.  
  5347.  
  5348.  
  5349.  
  5350.  
  5351.  
  5352.  
  5353.  
  5354.       DATEPACK - Pack a date into two bytes 
  5355.  
  5356.  
  5357.       Usage Call DatePack(UnpkDate$, PackDate$) 
  5358.  
  5359.          UnpkDate$      Date in MM/DD/YYYY format 
  5360.  
  5361.          PackDate$      Two byte packed date returned by the routine 
  5362.  
  5363.  
  5364.       Programming notes: 
  5365.  
  5366.       A '9' in the first byte of PackDate$ indicates an error has occurred. 
  5367.  
  5368.       PackDate$ must be initialized to 2 spaces before calling the routine. 
  5369.  
  5370.       For example: 
  5371.  
  5372.               UnpkDate$ = "01/01/1988" 
  5373.               PackDate$ = Space$(2) 
  5374.               Call DatePack$(UnpkDate$, PackDate$) 
  5375.  
  5376.   
  5377.       DATEUNPK - Unpack a date packed with DATEPACK 
  5378.  
  5379.  
  5380.       Usage Call DateUnpk(UnpkDate$, PackDate$) 
  5381.  
  5382.          UnpkDate$      Date in MM/DD/YYYY format returned by routine 
  5383.  
  5384.          PackDate$      Two byte packed date created by PACKDATE 
  5385.  
  5386.  
  5387.       Programming notes: 
  5388.  
  5389.       A '9' in the first character of PackDate$ indicates an error has occurred. 
  5390.  
  5391.       UnpkDate$ must be initialized to 10 spaces before calling the routine. 
  5392.  
  5393.       For example: 
  5394.  
  5395.               UnpkDate$ = "01/01/1988" 
  5396.               PackDate$ = Space$(2) 
  5397.               Call DatePack$(UnpkDate$, PackDate$) 
  5398.                     . 
  5399.                     . 
  5400.                     . 
  5401.  
  5402.               UnpkDate$ = Space$(10) 
  5403.  
  5404.                         Copyright (c) AJM Software 1987, 1991
  5405.                                 All Rights Reserved             Page 82
  5406.  
  5407.  
  5408.  
  5409.  
  5410.  
  5411.  
  5412.  
  5413.  
  5414.  
  5415.  
  5416.  
  5417.  
  5418.  
  5419.               Call DateUnpk$(UnpkDate$, Packdate$) 
  5420.  
  5421.  
  5422.       GREGTJUL - Convert a date from Gregorian to Julian format 
  5423.  
  5424.  
  5425.       Usage Call GregTJul(GregDate$, JulDate$) 
  5426.  
  5427.          GregDate$      Date in MM/DD/YY format 
  5428.  
  5429.          JulDate$       Date in YYDDD format returned by the routine 
  5430.  
  5431.  
  5432.       Programming notes: 
  5433.  
  5434.       GregTJul is written in QuickBasic. 
  5435.  
  5436.       GregTJul does not validate GregDate$, so a date like "00/30/1988" 
  5437.       will cause an Illegal function call. 
  5438.  
  5439.  
  5440.  
  5441.       JULTGREG - Convert a date from Julian to Gregorian format 
  5442.  
  5443.  
  5444.       Usage Call JulTGreg(GregDate$, JulDate$) 
  5445.  
  5446.          GregDate$      Date in MM/DD/YY format returned by the routine 
  5447.  
  5448.          JulDate$       Date in YYDDD format 
  5449.  
  5450.  
  5451.       Programming notes: 
  5452.  
  5453.       JulTGreg is written in QuickBasic. 
  5454.  
  5455.       JulTGreg does not validate JulDate$, so a date like "88999" 
  5456.       will cause an Illegal function call. 
  5457.  
  5458.  
  5459.       DAYSDIFF - Compute the number of days between two dates 
  5460.  
  5461.       Usage Call DaysDiff(Date1, Date2$, Diff%) 
  5462.  
  5463.          Date1$         Date in MM/DD/YY format 
  5464.  
  5465.          Date2$         Date in MM/DD/YY format 
  5466.  
  5467.          Diff%          Number of days between Date1$ and Date2$ 
  5468.  
  5469.  
  5470.                         Copyright (c) AJM Software 1987, 1991
  5471.                                 All Rights Reserved             Page 83
  5472.  
  5473.  
  5474.  
  5475.  
  5476.  
  5477.  
  5478.  
  5479.  
  5480.  
  5481.  
  5482.  
  5483.  
  5484.  
  5485.  
  5486.  
  5487.       Programming notes: 
  5488.  
  5489.       DaysDiff is written in QuickBasic and uses GregTJul. 
  5490.  
  5491.       DaysDiff does not validate dates, so a date like "31/31/88" 
  5492.       will cause an Illegal function call. 
  5493.  
  5494.       This routine returns the number of days between Date1$ and Date2$. 
  5495.       For Example: 
  5496.  
  5497.               Date1$ = "01/01/88" 
  5498.               Date2$ = "01/02/88" 
  5499.               Call DaysDiff(Date1$, Date2$, Diff%) 
  5500.  
  5501.       A '1' would be returned in Diff%.  If Date1$ is less than Date2$, Diff% 
  5502.       will be positive.  If Date1$ is equal to Date2$ then Diff% will be 
  5503.       zero, otherwise Diff% will be negative. 
  5504.  
  5505.       As it stands, DaysDiff cannot handle dates that are more than 32000 
  5506.       days apart.  If you need to handle this, change Diff% from integer to 
  5507.       single precision (Change the Call statement, and any reference 
  5508.       to Diff in the subroutine itself). 
  5509.  
  5510.  
  5511.       WEEKDAY  - Determine the day of the week 
  5512.  
  5513.       Usage - Call WeekDay(Date1$, Day%) 
  5514.  
  5515.          Date1$         Date in MM/DD/YY format 
  5516.  
  5517.          Day%           Day of the week - 0 = Sunday 
  5518.  
  5519.  
  5520.       Programming notes: 
  5521.  
  5522.       This routine uses DOS services to determine day of week, so it works 
  5523.       only for dates between 1980 and 1999. 
  5524.  
  5525.       A value of -1 in Day% indicates an error has occurred. 
  5526.  
  5527.  
  5528.       CALENDAR - Pop-up a calendar anywhere on the screen 
  5529.  
  5530.       Usage - Call Calendar(Top.Row%, Left.Col%, FgColor%, BgColor%) 
  5531.  
  5532.          Top.Row%       Top row of the calendar 
  5533.  
  5534.          Left.Col%      Left Column 
  5535.  
  5536.                         Copyright (c) AJM Software 1987, 1991
  5537.                                 All Rights Reserved             Page 84
  5538.  
  5539.  
  5540.  
  5541.  
  5542.  
  5543.  
  5544.  
  5545.  
  5546.  
  5547.  
  5548.  
  5549.  
  5550.  
  5551.  
  5552.          FgColor%       Foreground color 
  5553.  
  5554.          BgColor%       Background Color 
  5555.  
  5556.  
  5557.       Programming Notes: 
  5558.  
  5559.       This month's calendar is placed on the screen in the coordinates indi 
  5560.       cated. 
  5561.  
  5562.       The [Arrow] keys will change the month and year being displayed. 
  5563.  
  5564.       [Esc] returns control to your program. 
  5565.  
  5566.  
  5567.       ADDTIME  - Add two times together 
  5568.  
  5569.       Usage - Call AddTime(Time1$, Time2$, TimeSum$) 
  5570.  
  5571.          Time1$         Time in HH:MM:SS format (military time) 
  5572.  
  5573.          Time2$         Time in HH:MM:SS format (military time) 
  5574.  
  5575.          TimeSum        Sum of Time1$ and Time2$ in HH:MM:SS 
  5576.                         format 
  5577.  
  5578.  
  5579.       Programming notes: 
  5580.  
  5581.       This routine is written in Quickbasic 
  5582.  
  5583.       No validation is done, so invalid times (i.e. 99:99:88) will cause 
  5584.       unpredictable results. 
  5585.  
  5586.       Example: 
  5587.  
  5588.               Time1$ = "10:45:00" 
  5589.               Time2$ = "22:30:00" 
  5590.               Call AddTime$(Time1$, Time2$, TimeSum$) 
  5591.  
  5592.       TimeSum$ would equal "09:15:00".  This says that 22 and 1/2 hours 
  5593.       after 10:45 am puts us at 9:15 am. 
  5594.  
  5595.  
  5596.       SUBTIME  - Subtract two times 
  5597.  
  5598.       Usage - Call SubTime(Time1$, Time2$, TimeDiff$) 
  5599.  
  5600.          Time1$         Time in HH:MM:SS format (military time) 
  5601.  
  5602.                         Copyright (c) AJM Software 1987, 1991
  5603.                                 All Rights Reserved             Page 85
  5604.  
  5605.  
  5606.  
  5607.  
  5608.  
  5609.  
  5610.  
  5611.  
  5612.  
  5613.  
  5614.  
  5615.  
  5616.  
  5617.  
  5618.          Time2$         Time in HH:MM:SS format (military time) 
  5619.  
  5620.          TimeSum        Difference of Time1$ and Time2$ in HH:MM:SS 
  5621.                         format 
  5622.  
  5623.  
  5624.       Programming notes: 
  5625.  
  5626.       This routine is written in Quickbasic 
  5627.  
  5628.       No validation is done, so invalid times (i.e. 99:99:88) will cause 
  5629.       unpredictable results. 
  5630.  
  5631.       Example: 
  5632.  
  5633.               Time1$ = "10:45:00" 
  5634.               Time2$ = "22:30:00" 
  5635.               Call SubTime$(Time1$, Time2$, TimeSum$) 
  5636.  
  5637.       TimeSum$ would equal "12:15:00".  This says that 22 and 1/2 hours 
  5638.       before 10:45 am puts us at 12:15 pm. 
  5639.  
  5640.  
  5641.       Timer Services
  5642.           TIME 
  5643.           TICKS 
  5644.           BSGETIME 
  5645.  
  5646.  
  5647.       Usage - Call BsGeTime(High%, Low%, Days%, OHigh%, OLow%, ODays%) 
  5648.               ClTicks = FnTicks(High%, Low%, Days%) 
  5649.               ClTime$ = FnTime$(ClTicks) 
  5650.  
  5651.  
  5652.          High%          High order word of tick count 
  5653.  
  5654.          Low%           Low order word of tick count 
  5655.  
  5656.          Days%          Number of days since the clock (or computer) started 
  5657.  
  5658.          OHigh%         High order word of the tick count last time 
  5659.                         BsGeTime was called 
  5660.  
  5661.          OLow%          Low order word of the tick count last time 
  5662.                         BsGeTime was called 
  5663.  
  5664.          ODays%         Number of days elapsed since the clock started - last 
  5665.                         time BsGeTime was called 
  5666.  
  5667.  
  5668.                         Copyright (c) AJM Software 1987, 1991
  5669.                                 All Rights Reserved             Page 86
  5670.  
  5671.  
  5672.  
  5673.  
  5674.  
  5675.  
  5676.  
  5677.  
  5678.  
  5679.  
  5680.  
  5681.  
  5682.  
  5683.          ClTicks        Number of clock ticks since the computer was started 
  5684.  
  5685.          ClTime$        Number of clock ticks converted to time 
  5686.  
  5687.  
  5688.       Programming notes: 
  5689.  
  5690.       See the program TIMER.BAS in the sample programs as an example. 
  5691.  
  5692.       These functions are used primarily to compute the time required to 
  5693.       complete a process.  Time is accurate to 1/18th of a second. 
  5694.  
  5695.       Some TSR software intercept the timer and may cause the clock to slow 
  5696.       down.  This type of program will invalidate the numbers returned by 
  5697.       BsGeTime. 
  5698.  
  5699.       BsGeTime is written in Assembly, FnTime$ and FnTicks are functions 
  5700.       written in QuickBasic.  These routines are found in TIME.FN and 
  5701.       TICKS.FN, respectively. 
  5702.  
  5703.  
  5704.  
  5705.  
  5706.  
  5707.  
  5708.  
  5709.  
  5710.  
  5711.  
  5712.  
  5713.  
  5714.  
  5715.  
  5716.  
  5717.  
  5718.  
  5719.  
  5720.  
  5721.  
  5722.  
  5723.  
  5724.  
  5725.  
  5726.  
  5727.  
  5728.  
  5729.  
  5730.  
  5731.  
  5732.  
  5733.  
  5734.                         Copyright (c) AJM Software 1987, 1991
  5735.                                 All Rights Reserved             Page 87
  5736.  
  5737.  
  5738.  
  5739.  
  5740.  
  5741.  
  5742.  
  5743.  
  5744.  
  5745.  
  5746.  
  5747.  
  5748.  
  5749.  
  5750.                                    Video Primitives 
  5751.  
  5752.  
  5753.       Function Summary 
  5754.  
  5755.  
  5756.  
  5757.       PUTLINE  - Write a line of text to the video buffer 
  5758.  
  5759.       SAVESCR  - Copy a window from the video buffer to memory 
  5760.  
  5761.       RESTSCR  - Restore a window from memory to the video buffer 
  5762.  
  5763.       INPWIN   - Get input from the keyboard 
  5764.  
  5765.       COLORLIN - Change the background color of a line 
  5766.  
  5767.  
  5768.  
  5769.       NOTE:   As a general rule, you should not use these functions in 
  5770.               your programs.  The higher level functions described in 
  5771.               the following pages should be used in order to maintain 
  5772.               maximum compatibility with future releases of QBWARE. 
  5773.  
  5774.               One exception is INPWIN.  Use this routine for ALL input. 
  5775.  
  5776.  
  5777.  
  5778.  
  5779.  
  5780.  
  5781.  
  5782.  
  5783.  
  5784.  
  5785.  
  5786.  
  5787.  
  5788.  
  5789.  
  5790.  
  5791.  
  5792.  
  5793.  
  5794.  
  5795.  
  5796.  
  5797.  
  5798.  
  5799.  
  5800.                         Copyright (c) AJM Software 1987, 1991
  5801.                                 All Rights Reserved             Page 88
  5802.  
  5803.  
  5804.  
  5805.  
  5806.  
  5807.  
  5808.  
  5809.  
  5810.  
  5811.  
  5812.  
  5813.  
  5814.  
  5815.  
  5816.       PUTLINE  - Write a line of text to the video buffer 
  5817.  
  5818.       Usage - Call PutLine(Snow%, Text$, Row%, Col%, Fg%, Bg%) 
  5819.  
  5820.          Snow%          Display control 
  5821.                            1 - Raw display to video RAM 
  5822.                            0 - Display to video RAM after retrace 
  5823.  
  5824.          Text$          Text to display on the screen 
  5825.  
  5826.          Row%           Row at which the text should be placed 
  5827.  
  5828.          Col%           Column at which the text should be placed 
  5829.  
  5830.          Fg%            Foreground color of the text 
  5831.  
  5832.          Bg%            Background color of the text. 
  5833.  
  5834.  
  5835.       Programming notes: 
  5836.  
  5837.       This function has been tested and found to be compatible with MDA, 
  5838.       CGA, EGA and VGA in the text modes.  IBM-PC hardware compatibility is 
  5839.       required. 
  5840.  
  5841.       Snow% should always be 1 unless you see some distortion on the screen. 
  5842.       This distortion will appear on some of the older IBM CGA cards.  It 
  5843.       will not appear on EGA, VGA MDA and the newer CGA cards (e.g COMPAQ). 
  5844.       Originally, QBWARE provided the ability to print via BIOS for some 
  5845.       non-compatibles.  This feature was removed becuase it's too darn slow. 
  5846.  
  5847.  
  5848.       Col% and Row% should be treated as though they wer part of a locate 
  5849.       command (i.e. the upper left corner is col 1, row 1 not col 0, row 0). 
  5850.  
  5851.       See Appendix B for color codes. 
  5852.  
  5853.   
  5854.       SAVESCR  - Copy a window from the video buffer to memory 
  5855.  
  5856.       Usage - Call SaveScr(Tr%, Lc%, Br%, Rc%, StackSeg%, StackOff%) 
  5857.  
  5858.          Tr%            Top row of the area to copy 
  5859.  
  5860.          Lc%            Left column of the area to copy 
  5861.  
  5862.          Br%            Bottom row of the area to copy 
  5863.  
  5864.          Rc%            Right column of the area to copy 
  5865.  
  5866.                         Copyright (c) AJM Software 1987, 1991
  5867.                                 All Rights Reserved             Page 89
  5868.  
  5869.  
  5870.  
  5871.  
  5872.  
  5873.  
  5874.  
  5875.  
  5876.  
  5877.  
  5878.  
  5879.  
  5880.  
  5881.  
  5882.          StackSeg%      Segment of a far array which will hold the 
  5883.                         section of the screen 
  5884.  
  5885.          StackOff%      Offset of a far array which will hold the 
  5886.                         section of the screen 
  5887.  
  5888.  
  5889.       Programming notes: 
  5890.  
  5891.       This function allows you to copy a portion of the screen to a far array. 
  5892.       The portion of the screen can be restored using RestScr. 
  5893.  
  5894.       See WINSTACK.SUB as an example. 
  5895.  
  5896.       Use PushWin when saving a screen. 
  5897.  
  5898.       StackSeg% and StackOff% should point to the element of a far integer 
  5899.       array that will hold the screen. 
  5900.  
  5901.  
  5902.       RESTSCR  - Restore a window from memory to the video buffer 
  5903.  
  5904.       Usage - Call RestScr(Tr%, Lc%, Br%, Rc%, StackSeg%, StackOff%) 
  5905.  
  5906.          Tr%            Top row of the area to restore 
  5907.  
  5908.          Lc%            Left column of the area to restore 
  5909.  
  5910.          Br%            Bottom row of the area to restore 
  5911.  
  5912.          Rc%            Right column of the area to restore 
  5913.  
  5914.          StackSeg%      Segment of a far array which holds the 
  5915.                         section of the screen to restore 
  5916.  
  5917.          StackOff%      Offset of a far array which holds the 
  5918.                         section of the screen to restore 
  5919.  
  5920.  
  5921.       Programming notes: 
  5922.  
  5923.       This function allows you to restore a portion of the screen that was 
  5924.       copied to a far array using SaveScr. 
  5925.  
  5926.       See WINSTACK.SUB as an example. 
  5927.  
  5928.       Use PopWin when restoring a screen. 
  5929.  
  5930.       StackSeg% and StackOff% should point to the element of a far integer 
  5931.  
  5932.                         Copyright (c) AJM Software 1987, 1991
  5933.                                 All Rights Reserved             Page 90
  5934.  
  5935.  
  5936.  
  5937.  
  5938.  
  5939.  
  5940.  
  5941.  
  5942.  
  5943.  
  5944.  
  5945.  
  5946.  
  5947.       array that holds the screen. 
  5948.  
  5949.  
  5950.       INPWIN   - Get input from the keyboard 
  5951.  
  5952.       Usage - Call InpWin(WinStack%(), Input.Char$, Code%) 
  5953.  
  5954.          WinStack%()    The window stack 
  5955.  
  5956.          Input.Char$    Character retrieved from the keyboard buffer 
  5957.  
  5958.          Code%          0 - Return control to the calling program
  5959.                             only after a key has been pressed
  5960.                         1 - Return control to the calling program
  5961.                             immediately 
  5962.  
  5963.  
  5964.  
  5965.       Programming notes: 
  5966.  
  5967.       This is a replacement for the QB INKEY function. 
  5968.  
  5969.       THIS ROUTINE DISPLAYS THE STATUS BAR AND WILL PLAY A PROMINENT 
  5970.       ROLE IN FUTURE RELEASES OF QBWARE.  PLEASE USE THIS ROUTINE FOR 
  5971.       ALL KEYBOARD INPUT. 
  5972.  
  5973.       Using CODE% = 1 causes INPWIN to wait for keyboard input before 
  5974.       returning to the calling program.  Otherwise, control is returned 
  5975.       immediately even if there is no keyboard input. 
  5976.  
  5977.  
  5978.       COLORLIN - Change the color of a window 
  5979.  
  5980.       Usage - Call ColorLin(Snow%, Tr%, Lc%, Fg%, Bg%, Len%) 
  5981.  
  5982.          Snow%          Display control 
  5983.                            1 - Raw display to video RAM 
  5984.                            0 - Display to video RAM after retrace 
  5985.  
  5986.          Tr%            Top row of the area to color 
  5987.  
  5988.          Lc%            Left column of the area to color 
  5989.  
  5990.          Fg%            Foreground color 
  5991.  
  5992.          Bg%            Background color 
  5993.  
  5994.          Len%           Length of the line to be re-colored 
  5995.  
  5996.       Programming notes: 
  5997.  
  5998.  
  5999.                         Copyright (c) AJM Software 1987, 1991
  6000.                                 All Rights Reserved             Page 91
  6001.  
  6002.  
  6003.  
  6004.  
  6005.  
  6006.  
  6007.  
  6008.  
  6009.  
  6010.  
  6011.  
  6012.  
  6013.  
  6014.       See Appendix B for color codes. 
  6015.  
  6016.       If Fg% or Bg% is -1, the color will not be changed.  This allows you 
  6017.       to change only the foreground color or background color by itself. 
  6018.  
  6019.       In general do not use this function, use ColorWin. 
  6020.  
  6021.  
  6022.  
  6023.  
  6024.  
  6025.  
  6026.  
  6027.  
  6028.  
  6029.  
  6030.  
  6031.  
  6032.  
  6033.  
  6034.  
  6035.  
  6036.  
  6037.  
  6038.  
  6039.  
  6040.  
  6041.  
  6042.  
  6043.  
  6044.  
  6045.  
  6046.  
  6047.  
  6048.  
  6049.  
  6050.  
  6051.  
  6052.  
  6053.  
  6054.  
  6055.  
  6056.  
  6057.  
  6058.  
  6059.  
  6060.  
  6061.  
  6062.  
  6063.  
  6064.  
  6065.                         Copyright (c) AJM Software 1987, 1991
  6066.                                 All Rights Reserved             Page 92
  6067.  
  6068.  
  6069.  
  6070.  
  6071.  
  6072.  
  6073.  
  6074.  
  6075.  
  6076.  
  6077.  
  6078.  
  6079.  
  6080.  
  6081.                                    Window Routines 
  6082.  
  6083.  
  6084.  
  6085.       Function Summary 
  6086.  
  6087.  
  6088.       PUTWIND  - Pop up a window on the screen 
  6089.  
  6090.       PUSHWIN  - Copy a window from the video buffer to the screen stack 
  6091.  
  6092.       POPWIN   - Copy a window from the window stack to the video buffer 
  6093.  
  6094.       INITWIN  - Initialize windowing environment parameters 
  6095.  
  6096.       DEFWIN   - Define individual window parameters 
  6097.  
  6098.       CNGWIN   - Change window parameters 
  6099.  
  6100.       MOVEWIN  - Move a window to a different part of the screen 
  6101.  
  6102.       POPTEXT  - Display an array of text within a window 
  6103.  
  6104.       POPFTEXT - Display a formatted text window 
  6105.  
  6106.       COLORWIN - Recolor a window 
  6107.  
  6108.  
  6109.  
  6110.  
  6111.  
  6112.  
  6113.  
  6114.  
  6115.  
  6116.  
  6117.  
  6118.  
  6119.  
  6120.  
  6121.  
  6122.  
  6123.  
  6124.  
  6125.  
  6126.  
  6127.  
  6128.  
  6129.  
  6130.  
  6131.                         Copyright (c) AJM Software 1987, 1991
  6132.                                 All Rights Reserved             Page 93
  6133.  
  6134.  
  6135.  
  6136.  
  6137.  
  6138.  
  6139.  
  6140.  
  6141.  
  6142.  
  6143.  
  6144.  
  6145.  
  6146.  
  6147.       PUTWIND  - Pop up a window on the screen 
  6148.  
  6149.       Usage - Call PutWind(WinHandle%, WinStack%(), Head$) 
  6150.  
  6151.          WinHandle%     Window handle previously set up with DefWin 
  6152.  
  6153.          WinStack%()    The window stack 
  6154.  
  6155.          Head$          Heading to appear on the top line of the window 
  6156.  
  6157.  
  6158.       Programming notes: 
  6159.  
  6160.       If the handle has not been previously defined with DefWin, you will 
  6161.       get unpredictable results. 
  6162.  
  6163.       Read Appendix F for more information on the windowing routines. 
  6164.  
  6165.       This function displays a blank window on the screen.  The characteristics 
  6166.       of the window are defined by the handle. 
  6167.  
  6168.   
  6169.       PUSHWIN  - Copy a window from the video buffer to the screen stack 
  6170.  
  6171.       Usage - Call PushWin(WinHandle%, WinStack%(), WinFrame%() WinPoint%) 
  6172.  
  6173.          WinHandle%     Window handle previously set up with DefWin 
  6174.  
  6175.          WinStack%()    The window stack 
  6176.  
  6177.          WinFrame%()    The window frame definition 
  6178.  
  6179.          WinPoint%      The window stack pointer 
  6180.  
  6181.  
  6182.       Programming notes: 
  6183.  
  6184.       This function will copy the window defined by WinHandle% to the 
  6185.       screen stack. 
  6186.  
  6187.       Using an invalid handle will cause unpredictable results. 
  6188.  
  6189.       Read Appendix F for more information on the windowing routines. 
  6190.  
  6191.       Use PopWin to restore the window to the screen. 
  6192.  
  6193.  
  6194.       POPWIN   - Copy a window from the window stack to the video buffer 
  6195.  
  6196.  
  6197.                         Copyright (c) AJM Software 1987, 1991
  6198.                                 All Rights Reserved             Page 94
  6199.  
  6200.  
  6201.  
  6202.  
  6203.  
  6204.  
  6205.  
  6206.  
  6207.  
  6208.  
  6209.  
  6210.  
  6211.  
  6212.       Usage - Call PopWin(WinStack%(), WinFrame%() WinPoint%) 
  6213.  
  6214.          WinStack%()    The window stack 
  6215.  
  6216.          WinFrame%()    The window frame definition 
  6217.  
  6218.          WinPoint%      The window stack pointer 
  6219.  
  6220.  
  6221.       Programming notes: 
  6222.  
  6223.       Read Appendix F for more information on the windowing routines. 
  6224.  
  6225.       This function will re-display a window that was previously saved 
  6226.       with PushWin. 
  6227.  
  6228.       The last window that appeared on the screen will disappear as a 
  6229.       result of using this function.  If there are no windows on the 
  6230.       screen stack (i.e. you haven't used PushWin), unpredictable results 
  6231.       will occur. 
  6232.  
  6233.  
  6234.       INITWIN  - Initialize windowing environment parameters 
  6235.  
  6236.       Usage - Call InitWin(WinStack%(), WinFrame%, WinPoint%, MaxWin%, _ 
  6237.                            ExitKeys$, TabLen%, SBar%, SRow%, SFg%, SBg%, Snow%) 
  6238.  
  6239.          WinStack%()    The window stack 
  6240.  
  6241.          WinFrame%()    The window frame definition matrix 
  6242.  
  6243.          WinPoint%      The window stack pointer 
  6244.  
  6245.          MaxWin%        The maximum number of windows that can be defined 
  6246.  
  6247.          ExitKeys$      A string of scan codes that, when pressed, will 
  6248.                         cause a window routine to be exited. (See note below) 
  6249.  
  6250.          TabLen%        Tab length for PopText. 
  6251.  
  6252.          SBar%          0 - do not display a status bar 
  6253.                         1 - display a status bar 
  6254.  
  6255.          SRow%          Row where the status bar will be displayed. 
  6256.  
  6257.          SFg%           Status bar foreground color 
  6258.  
  6259.          SBg%           Status bar background color 
  6260.  
  6261.          Snow%          1 - Write directly to the video buffer 
  6262.  
  6263.                         Copyright (c) AJM Software 1987, 1991
  6264.                                 All Rights Reserved             Page 95
  6265.  
  6266.  
  6267.  
  6268.  
  6269.  
  6270.  
  6271.  
  6272.  
  6273.  
  6274.  
  6275.  
  6276.  
  6277.  
  6278.                         0 - Write directly to the video buffer after 
  6279.                             sync with horizontal retrace. 
  6280.  
  6281.  
  6282.       Programming notes: 
  6283.  
  6284.       This function defines parameters used by all of the other window routines. 
  6285.  
  6286.       Always set up the [Esc] key in ExitKeys$ (i.e. ExitKeys$ = Chr$(27)) 
  6287.       No other keys will function in this release. 
  6288.  
  6289.       Unless you have a good reason, set TabLen% at 8. 
  6290.  
  6291.       When displaying the Status bar, put it on line 1 or line 24 for best 
  6292.       results. 
  6293.  
  6294.       Use Snow% = 0 only for old IBM CGA adapters that show distortion on 
  6295.       the screen when the window routines are used.  Mono, EGA and VGA should 
  6296.       all have Snow% = 1.  Snow% = 0 will slow down the display. 
  6297.  
  6298.  
  6299.       DEFWIN   - Define individual window parameters 
  6300.  
  6301.       Usage - Call DefWin(WinHandle%, WinStack%(), Tr%, Lc%, Br%, Rc%, _ 
  6302.                           Frame%, Fg%, Bg%, Grow%, Shadow%) 
  6303.  
  6304.          WinHandle%     Window handle previously set up with DefWin 
  6305.  
  6306.          WinStack%()    The window stack 
  6307.  
  6308.          Tr%            Top row of the area to color 
  6309.  
  6310.          Lc%            Left column of the area to color 
  6311.  
  6312.          Br%            Bottom row of the area to color 
  6313.  
  6314.          Rc%            Right column of the area to color 
  6315.  
  6316.          Frame%         Frame description. 0 - No frame 
  6317.                                            1 - Single line frame 
  6318.                                            2 - Double line frame 
  6319.  
  6320.          Fg%            Foreground color 
  6321.  
  6322.          Bg%            Background color 
  6323.  
  6324.          Grow%          0 - Pop the window onto the screen 
  6325.                         1 - Make the window appear to grow onto the screen 
  6326.  
  6327.          Shadow%        0 - No shadow 
  6328.  
  6329.                         Copyright (c) AJM Software 1987, 1991
  6330.                                 All Rights Reserved             Page 96
  6331.  
  6332.  
  6333.  
  6334.  
  6335.  
  6336.  
  6337.  
  6338.  
  6339.  
  6340.  
  6341.  
  6342.  
  6343.  
  6344.                         1 - Shadow the window to provide a 3-D effect 
  6345.  
  6346.       Programming notes: 
  6347.  
  6348.       Any changes made here will not take effect until the next window 
  6349.       operation takes place (i.e. - If this handle is already displayed 
  6350.       on the screen, changing the background color from Blue to Red using 
  6351.       CngWin has no immediate effect.  You must re-display the window or 
  6352.       use ColorWin). 
  6353.  
  6354.       Read Appendix F for more information on the windowing routines. 
  6355.  
  6356.  
  6357.       CNGWIN   - Change window parameters 
  6358.  
  6359.       Usage - Call CngWin(WinHandle%, WinStack%(), Tr%, Lc%, Br%, Rc%, _ 
  6360.                           Frame%, Fg%, Bg%, Grow%, Shadow%) 
  6361.  
  6362.          WinHandle%     Window handle previously set up with DefWin 
  6363.  
  6364.          WinStack%()    The window stack 
  6365.  
  6366.          Tr%            Top row of the area to color 
  6367.  
  6368.          Lc%            Left column of the area to color 
  6369.  
  6370.          Br%            Bottom row of the area to color 
  6371.  
  6372.          Rc%            Right column of the area to color 
  6373.  
  6374.          Frame%         Frame description. 0 - No frame 
  6375.                                            1 - Single line frame 
  6376.                                            2 - Double line frame 
  6377.  
  6378.          Fg%            Foreground color 
  6379.  
  6380.          Bg%            Background color 
  6381.  
  6382.          Grow%          0 - Pop the window onto the screen 
  6383.                         1 - Make the window appear to grow onto the screen 
  6384.  
  6385.          Shadow%        0 - No shadow 
  6386.                         1 - Shadow the window to provide a 3-D effect 
  6387.  
  6388.       Programming notes: 
  6389.  
  6390.       Any changes made here will not take effect until the next window 
  6391.       operation takes place (i.e. - If this handle is already displayed 
  6392.       on the screen, changing the background color from Blue to Red using 
  6393.       CngWin has no immediate effect.  You must re-display the window or 
  6394.  
  6395.                         Copyright (c) AJM Software 1987, 1991
  6396.                                 All Rights Reserved             Page 97
  6397.  
  6398.  
  6399.  
  6400.  
  6401.  
  6402.  
  6403.  
  6404.  
  6405.  
  6406.  
  6407.  
  6408.  
  6409.  
  6410.       use ColorWin). 
  6411.  
  6412.       Read Appendix f for more information on the windowing routines. 
  6413.  
  6414.  
  6415.       MOVEWIN  - Move a window to a different part of the screen 
  6416.  
  6417.       Usage - Call MoveWin(WinHandle%, WinStack%(), WinPoint%, Tr%, Lc%) 
  6418.  
  6419.          WinHandle%     Not currently used 
  6420.  
  6421.          WinStack%()    The window stack 
  6422.  
  6423.          WinPoint%      The window stack pointer 
  6424.  
  6425.          Tr%            Top row of the new window location 
  6426.  
  6427.          Lc%            Left column of the new window location 
  6428.  
  6429.  
  6430.       Programming notes: 
  6431.  
  6432.       This function immediately moves the current window to the coordinates 
  6433.       indicated by Tr% and Lc%.  No re-sizing is done. 
  6434.  
  6435.       If there is no current window, unpredictable results will occur. 
  6436.  
  6437.  
  6438.       POPTEXT  - Display an array of text within a window 
  6439.  
  6440.       Usage - Call PopText(WinHandle%, WinStack%(), WinFrame%(), WinPoint%,_ 
  6441.                            Text$()) 
  6442.  
  6443.  
  6444.          WinHandle%     Not currently used 
  6445.  
  6446.          WinStack%()    The window stack 
  6447.  
  6448.          WinFrame%()    The window frame definition matrix 
  6449.  
  6450.          WinPoint%      The window stack pointer 
  6451.  
  6452.          Text$()        Array of text to be displayed in the window 
  6453.  
  6454.  
  6455.       Programming Notes: 
  6456.  
  6457.       This function will display the text in Text$() within the window 
  6458.       defined by WinHandle%. 
  6459.  
  6460.  
  6461.                         Copyright (c) AJM Software 1987, 1991
  6462.                                 All Rights Reserved             Page 98
  6463.  
  6464.  
  6465.  
  6466.  
  6467.  
  6468.  
  6469.  
  6470.  
  6471.  
  6472.  
  6473.  
  6474.  
  6475.  
  6476.       The window is automatically sized, that is, if an entry in Text$() 
  6477.       is too wide to fit in the window or if there are more lines in 
  6478.       Text$() than in the window, PopText automatically makes it fit 
  6479.       and allows you to use cursor control keys to display the entire 
  6480.       array. 
  6481.  
  6482.       See Appendix F for more information about cursor control while 
  6483.       a PopText window is being displayed. 
  6484.  
  6485.       If Text$() is empty, unpredictable results will occur. 
  6486.  
  6487.       Press a key defined in ExitKeys$ when InitWin was executed, to 
  6488.       exit PopText (press [Esc]). 
  6489.  
  6490.  
  6491.       POPFTEXT - Display a formatted text window 
  6492.  
  6493.       Usage - Call PopFText(WinHandle%, WinStack%(), WinFrame%(), WinPoint%,_ 
  6494.                            Location%(), TLength%(), TColors%(), Text$()) 
  6495.  
  6496.  
  6497.          WinHandle%     Not currently used 
  6498.  
  6499.          WinStack%()    The window stack 
  6500.  
  6501.          WinFrame%()    The window frame definition matrix 
  6502.  
  6503.          WinPoint%      The window stack pointer 
  6504.  
  6505.          Location%()    Two dimensional array containing the row and 
  6506.                         column where each data item will be placed. 
  6507.                         Row and column should be relative to the upper 
  6508.                         left corner of the window. 
  6509.  
  6510.          TLength%()     One dimensional array containing the length of 
  6511.                         each item to display. 
  6512.  
  6513.          TColors%()     Two dimensional array containing the foreground and 
  6514.                         background color of each item to display. 
  6515.  
  6516.          Text$()        Array of text to be displayed in the window 
  6517.  
  6518.  
  6519.       Programming Notes: 
  6520.  
  6521.       This function will display formatted text in the current window. 
  6522.  
  6523.       Press a key defined in ExitKeys$ when InitWin was executed, to 
  6524.       exit PopFText (press [Esc]) 
  6525.  
  6526.  
  6527.                         Copyright (c) AJM Software 1987, 1991
  6528.                                 All Rights Reserved             Page 99
  6529.  
  6530.  
  6531.  
  6532.  
  6533.  
  6534.  
  6535.  
  6536.  
  6537.  
  6538.  
  6539.  
  6540.  
  6541.  
  6542.       Remember, Location%() is relative to the upper left corner of the 
  6543.       current window. 
  6544.  
  6545.       If TColors%() is 0, then the colors used will be the default window 
  6546.       colors. 
  6547.  
  6548.  
  6549.       COLORWIN - Recolor a window 
  6550.  
  6551.       Usage - Call ColorWin(Fg%, Bg%) 
  6552.  
  6553.          Fg%            New foreground color 
  6554.  
  6555.          Bg%            New background color 
  6556.  
  6557.  
  6558.       Programming Notes: 
  6559.  
  6560.       This function changes the foreground and background of the current 
  6561.       window.  The new colors affect only the window onscreen.  If the 
  6562.       same handle is used again, the old colors will be used. 
  6563.  
  6564.  
  6565.  
  6566.  
  6567.  
  6568.  
  6569.  
  6570.  
  6571.  
  6572.  
  6573.  
  6574.  
  6575.  
  6576.  
  6577.  
  6578.  
  6579.  
  6580.  
  6581.  
  6582.  
  6583.  
  6584.  
  6585.  
  6586.  
  6587.  
  6588.  
  6589.  
  6590.  
  6591.  
  6592.  
  6593.                         Copyright (c) AJM Software 1987, 1991
  6594.                                 All Rights Reserved             Page 100
  6595.  
  6596.  
  6597.  
  6598.  
  6599.  
  6600.  
  6601.  
  6602.  
  6603.  
  6604.  
  6605.  
  6606.  
  6607.  
  6608.  
  6609.                                     Input Routines 
  6610.  
  6611.  
  6612.       Function Summary 
  6613.  
  6614.  
  6615.       INCHAR   - Accept input of a string of characters 
  6616.  
  6617.       INDATE   - Accept date input 
  6618.  
  6619.       INYES    - Accept yes/no input 
  6620.  
  6621.       INMF     - Accept male/female input 
  6622.  
  6623.  
  6624.  
  6625.  
  6626.  
  6627.  
  6628.  
  6629.  
  6630.  
  6631.  
  6632.  
  6633.  
  6634.  
  6635.  
  6636.  
  6637.  
  6638.  
  6639.  
  6640.  
  6641.  
  6642.  
  6643.  
  6644.  
  6645.  
  6646.  
  6647.  
  6648.  
  6649.  
  6650.  
  6651.  
  6652.  
  6653.  
  6654.  
  6655.  
  6656.  
  6657.  
  6658.  
  6659.                         Copyright (c) AJM Software 1987, 1991
  6660.                                 All Rights Reserved             Page 101
  6661.  
  6662.  
  6663.  
  6664.  
  6665.  
  6666.  
  6667.  
  6668.  
  6669.  
  6670.  
  6671.  
  6672.  
  6673.  
  6674.  
  6675.       INCHAR   - Accept input of a string of characters 
  6676.  
  6677.       Usage - Call InChar(WinHandle%, WinStack%(), WinFrame%(), Row%, Col% _ 
  6678.                           Fg%, Bg%, Pic$, Init$, ExitLst$, InputText$, Lstchr$) 
  6679.  
  6680.          WinHandle%     Not currently used 
  6681.  
  6682.          WinStack%()    The window stack 
  6683.  
  6684.          WinFrame%()    The window frame definition matrix 
  6685.  
  6686.          Row%           Starting Row (Relative to the current window) 
  6687.  
  6688.          Col%           Starting Column 
  6689.  
  6690.          Fg%            Foreground color 
  6691.  
  6692.          Bg%            Background color 
  6693.  
  6694.          Pic$           Picture definition of the input field 
  6695.  
  6696.          Init$          Initial value of the input field 
  6697.  
  6698.          ExitLst$       List of keys that, when pressed, will cause 
  6699.                         control to be returned to the calling program 
  6700.  
  6701.          InputText$     The field returned to the calling program that 
  6702.                         contains the input. 
  6703.  
  6704.          LstChr$        The last character entered. 
  6705.  
  6706.       Programming notes: 
  6707.  
  6708.       Init$ will be initially displayed by the input routine. 
  6709.  
  6710.       (See next page) 
  6711.  
  6712.  
  6713.  
  6714.       Pic$ describes the input field thru the use of a mask.  The 
  6715.       valid characters in Pic$ are: 
  6716.  
  6717.               U - Indicates this character will be translated to upper 
  6718.                   case 
  6719.  
  6720.               L - Indicates this character will be translated to lower 
  6721.                   case 
  6722.  
  6723.               X - Indicates no translation 
  6724.  
  6725.                         Copyright (c) AJM Software 1987, 1991
  6726.                                 All Rights Reserved             Page 102
  6727.  
  6728.  
  6729.  
  6730.  
  6731.  
  6732.  
  6733.  
  6734.  
  6735.  
  6736.  
  6737.  
  6738.  
  6739.  
  6740.  
  6741.               8 - Indicates only numerics will be accepted in this 
  6742.                   character. 
  6743.  
  6744.               9 - Indicates only numerics and blanks will be accepted. 
  6745.  
  6746.               Any other character will be displayed and input will not be 
  6747.               allowed in that character. 
  6748.  
  6749.       For example, when inputting Social Security Numbers, a mask of 
  6750.       "888-88-8888" will require a number wherever an '8' appears and will 
  6751.       not allow input wherever a '-' appears. 
  6752.  
  6753.       Row% and Col% are always relative to the upper left corner 
  6754.       of the current window. 
  6755.  
  6756.       Generally, it is a good idea to use only [Esc] and F1-F10 
  6757.       in ExitLst$. 
  6758.  
  6759.       When the end of the field is reached, control returns to the 
  6760.       calling program. 
  6761.  
  6762.       See Appendix F for a description of cursor control. 
  6763.  
  6764.       Depressing [Ins] will toggle insert mode off/on. 
  6765.  
  6766.       Backspace is destructive - that is, any character that you backspace 
  6767.       over is erased. 
  6768.  
  6769.       InChar, like all of the input routines, will maintain the status bar 
  6770.       if it is being displayed. 
  6771.  
  6772.  
  6773.       INDATE   - Accept date input 
  6774.  
  6775.       Usage - Call InDate(WinHandle%, WinStack%(), WinFrame%(), Row%, Col% _ 
  6776.                           Fg%, Bg%, Pic$, Init$, ExitLst$, InputText$, Lstchr$) 
  6777.  
  6778.          WinHandle%     Not currently used 
  6779.  
  6780.          WinStack%()    The window stack 
  6781.  
  6782.          WinFrame%()    The window frame definition matrix 
  6783.  
  6784.          Row%           Starting Row (Relative to the current window) 
  6785.  
  6786.          Col%           Starting Column 
  6787.  
  6788.          Fg%            Foreground color 
  6789.  
  6790.  
  6791.                         Copyright (c) AJM Software 1987, 1991
  6792.                                 All Rights Reserved             Page 103
  6793.  
  6794.  
  6795.  
  6796.  
  6797.  
  6798.  
  6799.  
  6800.  
  6801.  
  6802.  
  6803.  
  6804.  
  6805.  
  6806.          Bg%            Background color 
  6807.  
  6808.          Pic$           Not currently used 
  6809.  
  6810.          Init$          Initial value of the input field 
  6811.  
  6812.          ExitLst$       List of keys that, when pressed, will cause 
  6813.                         control to be returned to the calling program 
  6814.  
  6815.          InputText$     The field returned to the calling program that 
  6816.                         contains the input. 
  6817.  
  6818.          LstChr$        The last character entered. 
  6819.  
  6820.       Programming notes: 
  6821.  
  6822.       This subroutine will accept a valid date in MM/DD/YY format. 
  6823.  
  6824.       Row% and Col% are always relative to the current window. 
  6825.  
  6826.       Generally, it is a good idea to use only [Esc] and F1-F10 
  6827.       in ExitLst$. 
  6828.  
  6829.       When the end of the field is reached, control returns to the 
  6830.       calling program. 
  6831.  
  6832.       See Appendix F for a description of cursor control. 
  6833.  
  6834.  
  6835.       INYES    - Accept yes/no input 
  6836.  
  6837.       Usage - Call InYes(WinHandle%, WinStack%(), WinFrame%(), Row%, Col% _ 
  6838.                           Fg%, Bg%, Pic$, Init$, ExitLst$, InputText$, Lstchr$) 
  6839.  
  6840.          WinHandle%     Not currently used 
  6841.  
  6842.          WinStack%()    The window stack 
  6843.  
  6844.          WinFrame%()    The window frame definition matrix 
  6845.  
  6846.          Row%           Starting Row (Relative to the current window) 
  6847.  
  6848.          Col%           Starting Column 
  6849.  
  6850.          Fg%            Foreground color 
  6851.  
  6852.          Bg%            Background color 
  6853.  
  6854.          Pic$           Not currently used 
  6855.  
  6856.  
  6857.                         Copyright (c) AJM Software 1987, 1991
  6858.                                 All Rights Reserved             Page 104
  6859.  
  6860.  
  6861.  
  6862.  
  6863.  
  6864.  
  6865.  
  6866.  
  6867.  
  6868.  
  6869.  
  6870.  
  6871.  
  6872.          Init$          Initial value of the input field 
  6873.  
  6874.          ExitLst$       List of keys that, when pressed, will cause 
  6875.                         control to be returned to the calling program 
  6876.  
  6877.          InputText$     The field returned to the calling program that 
  6878.                         contains the input. 
  6879.  
  6880.          LstChr$        The last character entered. 
  6881.  
  6882.       Programming notes: 
  6883.  
  6884.       This routine will accept only a Yes/No input. 
  6885.  
  6886.       Row% and Col% are always relative to the current window. 
  6887.  
  6888.       Generally, it is a good idea to use only [Esc] and F1-F10 
  6889.       in ExitLst$. 
  6890.  
  6891.       When the end of the field is reached, control returns to the 
  6892.       calling program. 
  6893.  
  6894.       See Appendix F for a description of cursor control. 
  6895.  
  6896.  
  6897.       INMF     - Accept male/female input 
  6898.  
  6899.       Usage - Call InMF(WinHandle%, WinStack%(), WinFrame%(), Row%, Col% _ 
  6900.                           Fg%, Bg%, Pic$, Init$, ExitLst$, InputText$, Lstchr$) 
  6901.  
  6902.          WinHandle%     Not currently used 
  6903.  
  6904.          WinStack%()    The window stack 
  6905.  
  6906.          WinFrame%()    The window frame definition matrix 
  6907.  
  6908.          Row%           Starting Row (Relative to the current window) 
  6909.  
  6910.          Col%           Starting Column 
  6911.  
  6912.          Fg%            Foreground color 
  6913.  
  6914.          Bg%            Background color 
  6915.  
  6916.          Pic$           Not currently used 
  6917.  
  6918.          Init$          Initial value of the input field 
  6919.  
  6920.          ExitLst$       List of keys that, when pressed, will cause 
  6921.                         control to be returned to the calling program 
  6922.  
  6923.                         Copyright (c) AJM Software 1987, 1991
  6924.                                 All Rights Reserved             Page 105
  6925.  
  6926.  
  6927.  
  6928.  
  6929.  
  6930.  
  6931.  
  6932.  
  6933.  
  6934.  
  6935.  
  6936.  
  6937.  
  6938.  
  6939.          InputText$     The field returned to the calling program that 
  6940.                         contains the input. 
  6941.  
  6942.          LstChr$        The last character entered. 
  6943.  
  6944.       Programming notes:  
  6945.       This routine will accept only a Male/Female input. 
  6946.  
  6947.       Row% and Col% are always relative to the current window. 
  6948.  
  6949.       Generally, it is a good idea to use only [Esc] and F1-F10 
  6950.       in ExitLst$. 
  6951.  
  6952.       When the end of the field is reached, control returns to the 
  6953.       calling program. 
  6954.  
  6955.  
  6956.  
  6957.  
  6958.  
  6959.  
  6960.  
  6961.  
  6962.  
  6963.  
  6964.  
  6965.  
  6966.  
  6967.  
  6968.  
  6969.  
  6970.  
  6971.  
  6972.  
  6973.  
  6974.  
  6975.  
  6976.  
  6977.  
  6978.  
  6979.  
  6980.  
  6981.  
  6982.  
  6983.  
  6984.  
  6985.  
  6986.  
  6987.  
  6988.  
  6989.                         Copyright (c) AJM Software 1987, 1991
  6990.                                 All Rights Reserved             Page 106
  6991.  
  6992.  
  6993.  
  6994.  
  6995.  
  6996.  
  6997.  
  6998.  
  6999.  
  7000.  
  7001.  
  7002.  
  7003.  
  7004.  
  7005.                                     Menu Routines 
  7006.  
  7007.  
  7008.       Function Summary 
  7009.  
  7010.  
  7011.       BARMENU  - Provide a two line bar menu 
  7012.  
  7013.       BARMENU1 - Multi-line bar menu 
  7014.  
  7015.       BARMENU2 - Lotus-like bar menu 
  7016.  
  7017.       PULLDOWN - Display a pulldown menu 
  7018.  
  7019.       SCRLSLCT - Display a scrollable list of items for selection 
  7020.  
  7021.  
  7022.  
  7023.  
  7024.  
  7025.  
  7026.  
  7027.  
  7028.  
  7029.  
  7030.  
  7031.  
  7032.  
  7033.  
  7034.  
  7035.  
  7036.  
  7037.  
  7038.  
  7039.  
  7040.  
  7041.  
  7042.  
  7043.  
  7044.  
  7045.  
  7046.  
  7047.  
  7048.  
  7049.  
  7050.  
  7051.  
  7052.  
  7053.  
  7054.  
  7055.                         Copyright (c) AJM Software 1987, 1991
  7056.                                 All Rights Reserved             Page 107
  7057.  
  7058.  
  7059.  
  7060.  
  7061.  
  7062.  
  7063.  
  7064.  
  7065.  
  7066.  
  7067.  
  7068.  
  7069.  
  7070.  
  7071.       BARMENU  - Provide a two line bar menu 
  7072.  
  7073.       Usage - Call BarMenu(MenuList$(), Tr%, Fg%, Bg%, Snow%, RtnItm%) 
  7074.  
  7075.          MenuList$()    An array of items that will be displayed as 
  7076.                         a menu 
  7077.  
  7078.          Tr%            The top row of the displayed menu 
  7079.  
  7080.          Fg%            Foreground color of menu items 
  7081.  
  7082.          Bg%            Background color of the menu 
  7083.  
  7084.          Snow%          1 - Write directly to video RAM 
  7085.                         0 - Write directly to video RAM but wait for retrace 
  7086.                             to eliminate snow. 
  7087.  
  7088.          RtnItm%        Integer returned to the calling program.  This number 
  7089.                         is the array element that was selected. 
  7090.  
  7091.  
  7092.       Programming notes: 
  7093.  
  7094.       This function displays a two-line bar menu listing each selection 
  7095.       two spaces apart across each line.  An inverse bar is placed over the 
  7096.       currently selected item.  The bar can be moved by using the arrow keys. 
  7097.       Selection is made by pressing [Enter] or pressing the first letter of 
  7098.       a menu item. 
  7099.  
  7100.       Try to make each item start with a different letter. 
  7101.  
  7102.       Tr% should be either 1 or 23.  Using any other values will place the 
  7103.       menu in the middle of the screen. 
  7104.  
  7105.   
  7106.       BARMENU1 - Multi-line bar menu 
  7107.  
  7108.       Usage - Call BarMenu1(WinHandle%, WinStack%(), WinFrame%(), WinPoint% _ 
  7109.                             TblData$(), Answer%) 
  7110.  
  7111.          WinHandle%     Not currently used 
  7112.  
  7113.          WinStack%()    The window stack 
  7114.  
  7115.          WinFrame%()    The window frame definition matrix 
  7116.  
  7117.          WinPoint%      The window stack pointer 
  7118.  
  7119.          TblData$()     Array of items to be displayed in the menu. 
  7120.  
  7121.                         Copyright (c) AJM Software 1987, 1991
  7122.                                 All Rights Reserved             Page 108
  7123.  
  7124.  
  7125.  
  7126.  
  7127.  
  7128.  
  7129.  
  7130.  
  7131.  
  7132.  
  7133.  
  7134.  
  7135.  
  7136.  
  7137.          Answer%        Integer returned to the calling program.  This number 
  7138.                         is the array element that was selected. 
  7139.  
  7140.  
  7141.       Programming notes: 
  7142.  
  7143.       This subroutine displays the menu items in a vertical bar menu in the 
  7144.       current window.  An inverse bar is placed over the currently selected 
  7145.       item.  The bar can be moved by pressing the arrow keys or [Home] or 
  7146.       [End].  Pressing the first letter of a menu selection move the bar to 
  7147.       that item.  Pressing the [Space] bar selects an item. 
  7148.  
  7149.       Sorting the menu items (using PeSort), provides a more professional 
  7150.       output. 
  7151.  
  7152.  
  7153.       BARMENU2 - Lotus-like bar menu 
  7154.  
  7155.       Usage - Call BarMenu2(MenuList$(), Header$,Tr%, Fg%, Bg%, Snow%, RtnItm%) 
  7156.  
  7157.          MenuList$()    An array of items that will be displayed as 
  7158.                         a menu 
  7159.  
  7160.          Header$        Descriptive text that will appear with the menu 
  7161.  
  7162.          Tr%            The top row of the displayed menu 
  7163.  
  7164.          Fg%            Foreground color of menu items 
  7165.  
  7166.          Bg%            Background color of the menu 
  7167.  
  7168.          Snow%          1 - Write directly to video RAM 
  7169.                         0 - Write directly to video RAM but wait for retrace 
  7170.                             to eliminate snow. 
  7171.  
  7172.          RtnItm%        Integer returned to the calling program.  This number 
  7173.                         is the array element that was selected. 
  7174.  
  7175.  
  7176.       Programming notes: 
  7177.  
  7178.       This function displays a one-line bar menu listing each selection 
  7179.       two spaces apart across each line.  An inverse bar is placed over the 
  7180.       currently selected item.  The bar can be moved by using the arrow keys. 
  7181.       Selection is made by pressing [Enter] or pressing the first letter of 
  7182.       a menu item. 
  7183.  
  7184.       Try to make each item start with a different letter. 
  7185.  
  7186.  
  7187.                         Copyright (c) AJM Software 1987, 1991
  7188.                                 All Rights Reserved             Page 109
  7189.  
  7190.  
  7191.  
  7192.  
  7193.  
  7194.  
  7195.  
  7196.  
  7197.  
  7198.  
  7199.  
  7200.  
  7201.  
  7202.       Tr% should be either 1 or 23.  Using any other values will place the 
  7203.       menu in the middle of the screen. 
  7204.  
  7205.  
  7206.       PULLDOWN - Display a pulldown menu 
  7207.  
  7208.          Usage - Call PullDown(WinStack%(), WinFrame%(), WinPoint%, MenuList$()_ 
  7209.                      Start%, Tr%, Fg%, Bg%, MFg%, BFg%, RtnMnu%, RtnItm%) 
  7210.  
  7211.          WinStack%()    The window stack 
  7212.  
  7213.          WinFrame%()    The window frame definition matrix 
  7214.  
  7215.          WinPoint%      The window stack pointer 
  7216.  
  7217.          MenuList$()    Two-dimensional array of items to be displayed in the 
  7218.                         menu. 
  7219.  
  7220.          Start%         Starting menu to display 
  7221.  
  7222.          Tr%            The top row of the displayed menu 
  7223.  
  7224.          Fg%            Foreground color of menu bar 
  7225.  
  7226.          Bg%            Background color of the menu bar 
  7227.  
  7228.          MFg%           Foreground color of menu items 
  7229.  
  7230.          MBg%           Background color of the menu 
  7231.  
  7232.          RtnMnu%        Co-ordinates (array element numbers) of the item 
  7233.          RtnItm%        selected. 
  7234.  
  7235.       Programming notes: 
  7236.  
  7237.       Just like the QuickBasic menuing system. 
  7238.  
  7239.  
  7240.       SCRLSLCT - Display a scrollable list of items for selection 
  7241.  
  7242.       Usage - Call ScrlSlct(WinHandle%, WinStack%(), WinFrame%(), WinPoint%, _ 
  7243.                             TblData$(), TblSlct%()) 
  7244.  
  7245.          WinHandle%     Not currently used 
  7246.  
  7247.          WinStack%()    The window stack 
  7248.  
  7249.          WinFrame%()    The window frame definition matrix 
  7250.  
  7251.          WinPoint%      The window stack pointer 
  7252.  
  7253.                         Copyright (c) AJM Software 1987, 1991
  7254.                                 All Rights Reserved             Page 110
  7255.  
  7256.  
  7257.  
  7258.  
  7259.  
  7260.  
  7261.  
  7262.  
  7263.  
  7264.  
  7265.  
  7266.  
  7267.  
  7268.  
  7269.          TblData$()     One-dimensional array of items to be displayed in the 
  7270.                         menu. 
  7271.  
  7272.          TblSlct%()     One-dimensional array with the same number of elements 
  7273.                         as TblData$().  Each item should be initialized to 0. 
  7274.                         On return from ScrlSlct, each selected item will contain 
  7275.                         a -1 in its corresponding TblSlct% element. 
  7276.  
  7277.       Programming notes: 
  7278.  
  7279.       Items are displayed in the current window, so make sure it is wide 
  7280.       enough to accommodate the longest item. 
  7281.  
  7282.       The current item will have an inverse bar over it.  It may be selected 
  7283.       by pressing the [Space] bar.  Normal cursor control keys will move the 
  7284.       bar.  Additionally, pressing [Home] and [End] will position the bar over 
  7285.       the first and last items in the list.  Pressing the first letter of an 
  7286.       item will position the bar over that item.  When an item is selected, 
  7287.       a block will appear to the left of the item.  If the list is to deep 
  7288.       for the current window, [PgDn] and [PgUp] will place more items in the 
  7289.       window. 
  7290.  
  7291.  
  7292.  
  7293.  
  7294.  
  7295.  
  7296.  
  7297.  
  7298.  
  7299.  
  7300.  
  7301.  
  7302.  
  7303.  
  7304.  
  7305.  
  7306.  
  7307.  
  7308.  
  7309.  
  7310.  
  7311.  
  7312.  
  7313.  
  7314.  
  7315.  
  7316.  
  7317.  
  7318.  
  7319.                         Copyright (c) AJM Software 1987, 1991
  7320.                                 All Rights Reserved             Page 111
  7321.  
  7322.  
  7323.  
  7324.  
  7325.  
  7326.  
  7327.  
  7328.  
  7329.  
  7330.  
  7331.  
  7332.  
  7333.  
  7334.  
  7335.                                Miscellaneous Routines 
  7336.  
  7337.      Function Summary 
  7338.  
  7339.      PESORT     - Sort a character array 
  7340.  
  7341.      FNMODULO   - Find the modulus of a large number 
  7342.  
  7343.      QBCHIP     - Determine Processor and Co-Processor type
  7344.  
  7345.  
  7346.  
  7347.  
  7348.  
  7349.  
  7350.  
  7351.  
  7352.  
  7353.  
  7354.  
  7355.  
  7356.  
  7357.  
  7358.  
  7359.  
  7360.  
  7361.  
  7362.  
  7363.  
  7364.  
  7365.  
  7366.  
  7367.  
  7368.  
  7369.  
  7370.  
  7371.  
  7372.  
  7373.  
  7374.  
  7375.  
  7376.  
  7377.  
  7378.  
  7379.  
  7380.  
  7381.  
  7382.  
  7383.  
  7384.  
  7385.                         Copyright (c) AJM Software 1987, 1991
  7386.                                 All Rights Reserved             Page 112
  7387.  
  7388.  
  7389.  
  7390.  
  7391.  
  7392.  
  7393.  
  7394.  
  7395.  
  7396.  
  7397.  
  7398.  
  7399.  
  7400.  
  7401.       PESORT - Sort a character array 
  7402.  
  7403.       Usage - Call PeSort(List$(), Count%, Startpos%, SortLen%) 
  7404.  
  7405.          List$()        One dimensional array of character items to sort 
  7406.  
  7407.          Count%         Number of elements to sort 
  7408.  
  7409.          Startpos%      Starting position, relative to 1, of the sort key 
  7410.  
  7411.          SortLen%       Length of the sort key 
  7412.  
  7413.       Programming notes: 
  7414.  
  7415.       PeSort performs a partition-exchange sort that provides excellent 
  7416.       speed for all sizes of arrays. 
  7417.  
  7418.  
  7419.  
  7420.  
  7421.       FNMODULO - Find the modulus of a large number 
  7422.  
  7423.       Usage - Wrk.Mod = FnModulo(Target, Divisor) 
  7424.  
  7425.          Wrk.Mod        Modulus of Target and Divisor (single precision) 
  7426.  
  7427.          Target         Number for which you wish to find the Mod 
  7428.  
  7429.          Divisor        What else - the divisor 
  7430.  
  7431.  
  7432.       Programming notes: 
  7433.  
  7434.       This function will find the modulus for large numbers.  It's not 
  7435.       terribly efficient but it does work and can easily be adapted for 
  7436.       double precision numbers. 
  7437.  
  7438.  
  7439.      QBCHIP    - Determine Processor and Co-Processor type
  7440.  
  7441.      Usage - CALL QbChip(ProcTyp%, NDP%)
  7442.  
  7443.           ProcTyp%       Processor type
  7444.                          20  - NEC V20/V30
  7445.                          86  - 8086/8088
  7446.                          186 - 80186
  7447.                          286 - 80286
  7448.                          386 - 80386
  7449.                          486 - 80486
  7450.  
  7451.                         Copyright (c) AJM Software 1987, 1991
  7452.                                 All Rights Reserved             Page 113
  7453.  
  7454.  
  7455.  
  7456.  
  7457.  
  7458.  
  7459.  
  7460.  
  7461.  
  7462.  
  7463.  
  7464.  
  7465.  
  7466.           NDP%           Co-Processor type
  7467.                          0   - no Co-Processor found
  7468.                          87  - 8087
  7469.                          287 - 80287
  7470.                          387 - 80387
  7471.  
  7472.  
  7473.           Programming notes:
  7474.  
  7475.           The 486 chip has a built in math co-processor.
  7476.  
  7477.           The method  used to detect  the presence of a  486 processor will  not work
  7478.           while some protected mode programs are running (i.e. Windows).
  7479.  
  7480.  
  7481.  
  7482.  
  7483.  
  7484.  
  7485.  
  7486.  
  7487.  
  7488.  
  7489.  
  7490.  
  7491.  
  7492.  
  7493.  
  7494.  
  7495.  
  7496.  
  7497.  
  7498.  
  7499.  
  7500.  
  7501.  
  7502.  
  7503.  
  7504.  
  7505.  
  7506.  
  7507.  
  7508.  
  7509.  
  7510.  
  7511.  
  7512.  
  7513.  
  7514.  
  7515.  
  7516.  
  7517.                         Copyright (c) AJM Software 1987, 1991
  7518.                                 All Rights Reserved             Page 114
  7519.  
  7520.  
  7521.  
  7522.  
  7523.  
  7524.  
  7525.  
  7526.  
  7527.  
  7528.  
  7529.  
  7530.  
  7531.  
  7532.                                       Appendices
  7533.  
  7534.                                      Appendix A 
  7535.            
  7536.                                  Keyboard Scan Codes 
  7537.            
  7538.            
  7539.           Decimal           Character 
  7540.            
  7541.             3                 NUL 
  7542.             15                Shft-tab 
  7543.             16-25             Alt+(Q,W,E,R,T,Y,U,I,O,P) 
  7544.             30-38             Alt+(A,S,D,F,G,H,J,K,L) 
  7545.             44-50             Alt+(Z,X,C,V,B,N,M) 
  7546.             59,68             F1-F10 
  7547.             71                Home 
  7548.             72                Up cursor 
  7549.             73                PgUp 
  7550.             75                Left cursor 
  7551.             77                Right cursor 
  7552.             79                End 
  7553.             80                Down cursor 
  7554.             81                PgDn 
  7555.             82                Ins 
  7556.             83                Del 
  7557.             84-93             Shft-(F1-F10) 
  7558.             94-103            Ctrl-(F1-F10) 
  7559.             104-113           Alt+(F1-F10) 
  7560.             114               PrtSc 
  7561.             115               Left cursor 
  7562.             116               Right cursor 
  7563.             117               End 
  7564.             118               PgDn 
  7565.             119               Home 
  7566.             120-131           Alt+(1,2,3,4,5,6,7,8,9,0,-,=) 
  7567.             132               PgUp 
  7568.  
  7569.  
  7570.  
  7571.  
  7572.  
  7573.  
  7574.  
  7575.  
  7576.  
  7577.  
  7578.  
  7579.  
  7580.  
  7581.  
  7582.  
  7583.                         Copyright (c) AJM Software 1987, 1991
  7584.                                 All Rights Reserved             Page 115
  7585.  
  7586.  
  7587.  
  7588.  
  7589.  
  7590.  
  7591.  
  7592.  
  7593.  
  7594.  
  7595.  
  7596.  
  7597.  
  7598.                                      Appendix B 
  7599.  
  7600.                                     BASIC Colors 
  7601.            
  7602.            
  7603.           Color code               Color 
  7604.            
  7605.              0                     Black 
  7606.              1                     Blue 
  7607.              2                     Green 
  7608.              3                     Cyan 
  7609.              4                     Red 
  7610.              5                     Magenta 
  7611.              6                     Brown 
  7612.              7                     White 
  7613.              8                     Gray 
  7614.              9                     Light Blue 
  7615.              10                    Light Green 
  7616.              11                    Light Cyan 
  7617.              12                    Light Red 
  7618.              13                    Light Magenta 
  7619.              14                    Yellow 
  7620.              15                    High-Intensity White 
  7621.            
  7622.            
  7623.           Notes: 
  7624.            
  7625.           The only valid background colors are 0-7. 
  7626.            
  7627.           Add 16 (sixteen) to the color to cause blinking. 
  7628.  
  7629.  
  7630.  
  7631.  
  7632.  
  7633.  
  7634.  
  7635.  
  7636.  
  7637.  
  7638.  
  7639.  
  7640.  
  7641.  
  7642.  
  7643.  
  7644.  
  7645.  
  7646.  
  7647.  
  7648.  
  7649.                         Copyright (c) AJM Software 1987, 1991
  7650.                                 All Rights Reserved             Page 116
  7651.  
  7652.  
  7653.  
  7654.  
  7655.  
  7656.  
  7657.  
  7658.  
  7659.  
  7660.  
  7661.  
  7662.  
  7663.  
  7664.                                      Appendix C 
  7665.            
  7666.                               About Disks and Diskettes 
  7667.            
  7668.           DISK AND DISK FORMATS 
  7669.            
  7670.           Hard disks and floppy disks essentially use the same format under
  7671.           DOS.  There are four logical areas of interest on each disk - the
  7672.           boot  sector, the  FAT, the  root  directory and  the data  area.
  7673.           Physically,  data is recorded on a  series of tracks.  Each track
  7674.           is  further  divided into  areas  called sectors.    The physical
  7675.           capacity of each disk varies considerably from drive to drive. 
  7676.            
  7677.           There are  only two  characteristics of disks  that are  fixed by
  7678.           hardware constraints  - the number  of sides and the  location of
  7679.           each track on the disk.  The size and number of sectors and their
  7680.           location within  each track  is totally  under software  control.
  7681.           Each  of these  characteristics  is  defined  by  the  formatting
  7682.           software (the FORMAT program usually).  We'll discuss most of the
  7683.           DOS formats shortly.   Sectors can  be placed on  a track in  any
  7684.           order and in  any combination of 4 sizes - 128,  256, 512 or 1024
  7685.           bytes.   Generally it is  wise to use a  sector size of 512 bytes
  7686.           because that's the standard and there are probably many programs,
  7687.           including DOS, that depend on a 512 byte sector size. 
  7688.            
  7689.           There are  several standard formats  currently used by DOS.   The
  7690.           following table summarizes each format and it's characteristics. 
  7691.            
  7692.                Type       Sides        Sectors      Tracks      Bytes 
  7693.            
  7694.                SSDD-8      1              8             40          160,000
  7695.                DSDD-8      2              8             40          320,000
  7696.                SSDD-9      1             9            40         180,000   
  7697.                DSDD-9      2             9            40         360,000
  7698.                3 1/2 in.   2             9            80         720,000
  7699.                DDHD        2             15           80       1,200,000 
  7700.  
  7701.           The  most common  of these formats  is the  DSDD-9, but  with the
  7702.           introduction of laptops and the PS/2 line from IBM, the 3 1/2 in.
  7703.           diskettes will probably become the  standard of the future.  When
  7704.           using the  BIOS to  access disks, it  is important  to understand
  7705.           their characteristics.   Bios disk access routines  require us to
  7706.           know three things about the particular sector  that we're looking
  7707.           for.  These are  the track number,  the cylinder number, and  the
  7708.           sector number,  The first track on a disk is always 0.  Diskettes
  7709.           with 40  tracks will  have them numbered  0 -  39.   The cylinder
  7710.           number is  sometimes called the side  or head number.   It really
  7711.           represents  which side of  the diskette we  want to  read, top or
  7712.           bottom.  Cylinder is 0  for top or 1 for bottom.   Hard disks may
  7713.           have more than  two cylinders.  Sector numbers  always start with
  7714.  
  7715.                         Copyright (c) AJM Software 1987, 1991
  7716.                                 All Rights Reserved             Page 117
  7717.  
  7718.  
  7719.  
  7720.  
  7721.  
  7722.  
  7723.  
  7724.  
  7725.  
  7726.  
  7727.  
  7728.  
  7729.  
  7730.           1.   Therefore, the  first sector on  a disk  is always  Track 0,
  7731.           Cylinder 0, Sector 1.  As I  said earlier, DOS organizes the disk
  7732.           into four areas.  We'll examine each of these separately. 
  7733.            
  7734.            
  7735.           The Boot Sector 
  7736.            
  7737.           The  boot sector  contains  a  short program  used  to start  the
  7738.           computer and it also contains  the characteristics of the disk in
  7739.           an area called the BIOS parameter block.  The  short program does
  7740.           one  of  two  things  -  it  loads  the  three  startup  modules,
  7741.           IBMBIO.COM, IBMDOS.COM, and COMMAND.COM  and transfers control to
  7742.           COMMAND.COM or it displays a message stating that the diskette is
  7743.           not a bootable one.  The format of the boot sector is as follows:
  7744.  
  7745.            
  7746.                Location         Description 
  7747.            
  7748.                0-2           Branch to first byte of boot code 
  7749.                3-29         BIOS parameter block 
  7750.                3-10          System ID 
  7751.                11-12         Number of bytes/sector 
  7752.                13            Number of sectors/cluster 
  7753.                14-15         Number of reserved sectors at beginning 
  7754.                16            Number of FAT's 
  7755.                17-18         Number of root directory entries 
  7756.                19-20         Total number of sectors on disk 
  7757.                21            Format ID 
  7758.                22-23         Number of sectors/FAT 
  7759.                24-25         Number of sectors/track 
  7760.                26-27         Number of cylinders 
  7761.                28-29         Number of special reserved sectors 
  7762.            
  7763.            
  7764.           The rest  of the boot  program follows the BIOS  parameter block.
  7765.           At the end  of the boot record, we need the two-byte signature, a
  7766.           hex 55AA. 
  7767.            
  7768.            
  7769.           The Root Directory 
  7770.            
  7771.           The directory  holds basic  information about  each file.   There
  7772.           can, of course, be more than one directory, but there is only one
  7773.           root  directory.  Subdirectories have essentially the same format
  7774.           as the  root directory, but there  is one notable  difference.  A
  7775.           subdirectory is really another file - a special type of file.  As
  7776.           a file, it can grow to virtually any size and have any number  of
  7777.           entries (not  totally true, but  there are no  PRACTICAL limits).
  7778.           The root directory is fixed in length and therefore can have only
  7779.           a limited  number of entries.   This is usually 64 or  112.  Each
  7780.  
  7781.                         Copyright (c) AJM Software 1987, 1991
  7782.                                 All Rights Reserved             Page 118
  7783.  
  7784.  
  7785.  
  7786.  
  7787.  
  7788.  
  7789.  
  7790.  
  7791.  
  7792.  
  7793.  
  7794.  
  7795.  
  7796.           entry in  the directory  uses  32 bytes,  so  we are  limited  to
  7797.           sixteen entries per  sector.  Each  entry contains the  following
  7798.           eight fields: 
  7799.            
  7800.                Position      Description 
  7801.            
  7802.                0-7            Filename 
  7803.                8-10           Filename extension 
  7804.                11             Attribute 
  7805.                12-21          Reserved 
  7806.                22-23          Last update time 
  7807.                24-25          Last update date 
  7808.                26-27          First FAT entry 
  7809.                28-31          File size 
  7810.            
  7811.            
  7812.           The Data Area 
  7813.            
  7814.           The data area is  the largest area on the disk.   It is where our
  7815.           files are  actually placed.   Space is allocated in  units called
  7816.           clusters.  A cluster is made up of  one or more sectors.  This is
  7817.           defined at  disk format time.  That is  all we need to know about
  7818.           the data area. 
  7819.            
  7820.            
  7821.           THE FAT 
  7822.            
  7823.           The FAT - file allocation table - keeps track of where  our files
  7824.           physically reside on  disk.   The  directory entry for  each file
  7825.           contains the address of the  first sector that the file occupies.
  7826.           If the file occupies more than 1 sector, DOS keeps track of it in
  7827.           the FAT.   There are  generally two  copies of the  FAT on  every
  7828.           disk.   DOS updates both  copies, but only  uses one of  them for
  7829.           file retrieval.  FAT's have one of two formats - a 12 bit or a 16
  7830.           bit format.   The 12 bit  format allows you  to access just  over
  7831.           4,000  clusters, so  it is  used primarily  in diskettes  and the
  7832.           smaller hard  disks.  The 16 bit format  allows us to access many
  7833.           more clusters and facilitate larger hard disks.  It is because of
  7834.           the FAT  entry size that we are limited, by  DOS, to a maximum 32
  7835.           Meg hard  disk  (although there  are  several programs,  such  as
  7836.           SPEEDSTOR  by Storage  Dimensions, Inc.  that do  away  with this
  7837.           limitation and  in fact, some  versions of DOS 3.3x  also provide
  7838.           work-arounds for this  limit - the most notable  being COMPAQ DOS
  7839.           3.31).   DOS  V4.00 is  the  first general  release  of DOS  that
  7840.           eliminates this limitation.
  7841.            
  7842.           Each  byte in  the  FAT represents  a cluster  and  tells us  the
  7843.           disposition of that  cluster.  The first two bytes in the FAT are
  7844.           reserved and are not used for this purpose. 
  7845.             
  7846.  
  7847.                         Copyright (c) AJM Software 1987, 1991
  7848.                                 All Rights Reserved             Page 119
  7849.  
  7850.  
  7851.  
  7852.  
  7853.  
  7854.  
  7855.  
  7856.  
  7857.  
  7858.  
  7859.  
  7860.  
  7861.  
  7862.           For illustration, we will use a 12 bit FAT.  The allowable values
  7863.           in each entry are: 
  7864.  
  7865.                Value          Description 
  7866.            
  7867.                0              The cluster is unused and available for use 
  7868.                1-FF0(4080)    A  pointer to the next cluster that this file
  7869.                                                   occupies. 
  7870.                FF7(4087)      The  cluster has been  flagged as unusable by
  7871.                               FORMAT.  This occurs  when the format program
  7872.                               cannot  successfully  write  to  one  of  the
  7873.                               sectors in the cluster. 
  7874.                FFE(4094)      The  cluster is  not used but  is unavailable
  7875.                               for  use.  This occurs only when DOS reserves
  7876.                               a cluster. 
  7877.                FFF(4095)      This indicates that this is the  last cluster
  7878.                               that a file occupies. 
  7879.            
  7880.           As you can see, the FAT links together the clusters that  make up
  7881.           a file. It is also  easy to see that if the  FAT becomes damaged,
  7882.           your disk  or diskette becomes  so much trash.   In general, it's
  7883.           not a good idea to manipulate the FAT unless your an  experienced
  7884.           programmer. 
  7885.            
  7886.            
  7887.           FORMATTING A DISKETTE 
  7888.            
  7889.           Please  keep in  mind that  these  procedures are  directed to  a
  7890.           floppy  disk only.    In  principle, formatting  a  hard disk  is
  7891.           similar, but don't try it with these guidelines. 
  7892.            
  7893.           Formatting a diskette is a four-step process. 
  7894.            
  7895.                1    Format each track of the diskette 
  7896.                2    Write the boot sector 
  7897.                3    Initialize the FAT 
  7898.                4    Initialize the root directory 
  7899.            
  7900.           We can format each  track of a diskette using  the BsDFmt service
  7901.           provided in QBWARE.  Note that this service requires the use of a
  7902.           'track  format table'.  This  table contains a 4-bytes descriptor
  7903.           for each  sector being formatted.   Individual sectors  cannot be
  7904.           formatted.   You must format  an entire track with  one BIOS call
  7905.           but the track format table  lets us define the characteristics of
  7906.           each sector.  The track format table looks like this: 
  7907.            
  7908.                Byte 1     - track being formatted 
  7909.                Byte 2     - Head being formatted 
  7910.                Byte 3     - Sector being formatted 
  7911.                Byte 4     - size code 
  7912.  
  7913.                         Copyright (c) AJM Software 1987, 1991
  7914.                                 All Rights Reserved             Page 120
  7915.  
  7916.  
  7917.  
  7918.  
  7919.  
  7920.  
  7921.  
  7922.  
  7923.  
  7924.  
  7925.  
  7926.  
  7927.  
  7928.            
  7929.           The size code has the following values: 
  7930.            
  7931.                0    128 byte sectors 
  7932.                1    256 byte sectors 
  7933.                2    512 byte sectors 
  7934.                3    1024 byte sectors 
  7935.  
  7936.           QBFORMAT.BAS is included with  the sample programs as an  example
  7937.           of Diskette formatting.  It does work, however, it doesn't do any
  7938.           error checking. 
  7939.            
  7940.            
  7941.            COPY PROTECTION 
  7942.            
  7943.           Using  the  BIOS format  service,  we  can  devise our  own  copy
  7944.           protection schemes.   These schemes  are not as elaborate  as the
  7945.           schemes  used by  some  of  the  larger  software  houses  (these
  7946.           actually use special hardware to put junk in places on a diskette
  7947.           that are read-only  accessible to a standard  floppy controller),
  7948.           but can  be effective  against the casual  software pirate.   The
  7949.           means available to us are: 
  7950.            
  7951.                - leave out a sector number in the track format table 
  7952.                - place a unique number in the track format table 
  7953.                - format ten sectors on one or more tracks 
  7954.                - change the sizes of one or more sectors on a track 
  7955.                - format past track 39 
  7956.                - change the interleave 
  7957.            
  7958.           Be  careful, not all  of these techniques  work consistently with
  7959.           all floppy disk controllers. 
  7960.  
  7961.  
  7962.  
  7963.  
  7964.  
  7965.  
  7966.  
  7967.  
  7968.  
  7969.  
  7970.  
  7971.  
  7972.  
  7973.  
  7974.  
  7975.  
  7976.  
  7977.  
  7978.  
  7979.                         Copyright (c) AJM Software 1987, 1991
  7980.                                 All Rights Reserved             Page 121
  7981.  
  7982.  
  7983.  
  7984.  
  7985.  
  7986.  
  7987.  
  7988.  
  7989.  
  7990.  
  7991.  
  7992.  
  7993.  
  7994.            
  7995.                                      APPENDIX D 
  7996.            
  7997.                            Using the File Access Services 
  7998.            
  7999.            
  8000.           All  of  the file  access  services  use  the DOS  extended  file
  8001.           services.  These  services call for the  use of file handles  - a
  8002.           UNIX concept.   Because of this we are still limited to a maximum
  8003.           of  20 open files in any  Quickbasic program. This includes the 5
  8004.           standard  files  that  DOS  requires  effectively  limiting   any
  8005.           Quickbasic program to 15 open files at any one time.  This should
  8006.           normally be enough,  however, if it becomes a  problem, there are
  8007.           some facilities in  QBWARE that will allow you to  open more than
  8008.           15 files, but still we cannot  exceed 20.  If you must  have more
  8009.           than 20 open files, you must use the old FCB style file services.
  8010.           This will  allow you  to access up  to 255  files simultaneously.
  8011.           These routines are available from  AJM Software and if you'd like
  8012.           them, just  write (Note: DOS 3.3  will allow 255 open  files, so,
  8013.           that's you're best bet). 
  8014.  
  8015.           Using  the file  access services  requires the  use of  an ASCIIZ
  8016.           string.   This is simply  a file  name (or part  of a file  name)
  8017.           followed by a null.  Some examples of ASCIIZ strings:  
  8018.  
  8019.                FlSpec$ = "C:COMMAND.COM" + Chr$(0) 
  8020.                Path$   = "\QUICKBAS" + Chr$(0) 
  8021.            
  8022.           The standard  error codes for  all of the QBWARE  file management
  8023.           routines except FLRSECT and FLWSECT are as follows: 
  8024.            
  8025.                Code      Reason 
  8026.            
  8027.                0         service completed successfully 
  8028.                1         invalid request 
  8029.                2         file not found or path invalid 
  8030.                3         path not found 
  8031.                4         no handle available 
  8032.                5         access denied 
  8033.                6         invalid handle 
  8034.                12        invalid access code 
  8035.                15        invalid drive specification 
  8036.                17        not the same device (FLMOVE only) 
  8037.                18        no matching directory entry found 
  8038.                22        attempt to delete current directory 
  8039.                80        file already exists 
  8040.                255       invalid parameter 
  8041.  
  8042.  
  8043.  
  8044.  
  8045.                         Copyright (c) AJM Software 1987, 1991
  8046.                                 All Rights Reserved             Page 122
  8047.  
  8048.  
  8049.  
  8050.  
  8051.  
  8052.  
  8053.  
  8054.  
  8055.  
  8056.  
  8057.  
  8058.  
  8059.  
  8060.            
  8061.                                      Appendix E 
  8062.            
  8063.                                   The Print Spooler 
  8064.            
  8065.            
  8066.           Version 3.00 of  DOS brought with it  a remarkable new  program -
  8067.           the print spooler.   The spooler is remarkable  because it allows
  8068.           you to print files  in the background while the computer  is free
  8069.           to  do other  tasks.   It  is somewhat  limited in  that  it does
  8070.           automatically capture data going to  the printer and spool it for
  8071.           you and it must be used from the DOS prompt.  In order to use it,
  8072.           you must  write your report to a file  and subsequently go to the
  8073.           DOS prompt and submit it to the  print queue - either manually or
  8074.           through  a batch  file.   The  services provided  in QBWARE  will
  8075.           assist   in  incorporating  the   spooler  into   any  Quickbasic
  8076.           application.  You must still write each  report to a file, but we
  8077.           can, with DOSPSUB, submit the file to
  8078.           the print queue directly from a Quickbasic program.  
  8079.            
  8080.           In order to use QBWARE spooler service, we must start the spooler
  8081.  
  8082.           before  your Quickbasic basic program  executes.  The spooler can
  8083.           be started  from the  DOS prompt or  from your  AUTOEXEC.BAT file
  8084.           (any BAT file will do).   The spooler program is called PRINT.EXE
  8085.           and  is available  on  your  DOS version  3.XX  diskettes.   When
  8086.           starting the spooler, there are several options that can be used.
  8087.           These are: 
  8088.            
  8089.                /D   Device that all files will  be printed on - if omitted,
  8090.                     the spooler will prompt you for a device name 
  8091.            
  8092.                /Q   Maximum number of files that  can be in the print queue
  8093.                     - the default is 4 and the absolute maximum that can be
  8094.                     used is 32 
  8095.            
  8096.                /B   Buffersize of the internal buffer used by the spooler -
  8097.                     the default  is 512 bytes  - we always use  2048 bytes,
  8098.                     but the  correct value  will depend  on overall  system
  8099.                     usage 
  8100.            
  8101.                /S   Timeslice for the spooler -  this defines the number of
  8102.                     clock ticks that the spooler  will use - the default is
  8103.                     8 and the values can range from 1-255 
  8104.            
  8105.                /M   Specifies  the maximum  number  of clockticks  that the
  8106.                     spooler will use  to print a character -  values can be
  8107.                     1-255 and the default is 2 
  8108.            
  8109.                /U   Specifies  the number  of clockticks  that  the spooler
  8110.  
  8111.                         Copyright (c) AJM Software 1987, 1991
  8112.                                 All Rights Reserved             Page 123
  8113.  
  8114.  
  8115.  
  8116.  
  8117.  
  8118.  
  8119.  
  8120.  
  8121.  
  8122.  
  8123.  
  8124.  
  8125.  
  8126.                     will wait for the printer  to become available - values
  8127.                     can range from 1-255 and the default is 1 
  8128.             
  8129.           The command 
  8130.            
  8131.                PRINT /D:LPT1 /B:2048 /Q:32 
  8132.            
  8133.           will activate the  spooler with an internal buffer  of 2048 bytes
  8134.           and cause all output to be  spooled to LPT1.  The maximum  number
  8135.           of files that can  be in the queue at one time is  32.  Once this
  8136.           is completed, the routines in QBWARE can be used. 
  8137.            
  8138.           Return codes from the spooler are as follows: 
  8139.            
  8140.                Rc             Reason 
  8141.            
  8142.                0              Successful 
  8143.                1              Spooler inactive 
  8144.                2              Spooler inactive (DOSPSTAT only) 
  8145.                2              File not found 
  8146.                3              Path not found 
  8147.                4              Too many open files 
  8148.                5              Access denied 
  8149.                8              Queue full 
  8150.                9              Spooler busy 
  8151.                12             Name too long 
  8152.                15             Invalid drive 
  8153.                255            Invalid DOS version 
  8154.  
  8155.  
  8156.  
  8157.  
  8158.  
  8159.  
  8160.  
  8161.  
  8162.  
  8163.  
  8164.  
  8165.  
  8166.  
  8167.  
  8168.  
  8169.  
  8170.  
  8171.  
  8172.  
  8173.  
  8174.  
  8175.  
  8176.  
  8177.                         Copyright (c) AJM Software 1987, 1991
  8178.                                 All Rights Reserved             Page 124
  8179.  
  8180.  
  8181.  
  8182.  
  8183.  
  8184.  
  8185.  
  8186.  
  8187.  
  8188.  
  8189.  
  8190.  
  8191.  
  8192.                                       Appendix F
  8193.            
  8194.                               QBWARE Windowing Routines 
  8195.            
  8196.            
  8197.           These are some general notes  about the windowing routines.  Most
  8198.           of
  8199.           the  routines are  written in  QuickBasic so  they can  be easily
  8200.           modified to  suit individual  needs.  There  are a  few Assembler
  8201.           routines,  but they  are low-level  and hopefully  will not  need
  8202.           modification. 
  8203.            
  8204.           The windowing  routines have been  tested with MDA, CGA,  EGA and
  8205.           VGA adapters.   THEY ARE DESIGNED  TO FUNCTION IN THE  TEXT MODES
  8206.           ONLY.  They have not  been checked out on Hercules mono  graphics
  8207.           so I don't know  what will happen if you use the  routine on that
  8208.           hardware - but I suspect they won't work. 
  8209.            
  8210.           First, a little terminology: 
  8211.            
  8212.                WINDOW STACK 
  8213.            
  8214.           This is an  integer array where some general  information is kept
  8215.           about  the windowing  environment such  as whether  to display  a
  8216.           status  bar, what  color status  bar, etc.   It's  main function,
  8217.           however, is  to store screen  images that are being  overlayed by
  8218.           windows.  This enables the windowing to quickly popup a window on
  8219.           the  screen  and subsequently  remove  it  - leaving  the  screen
  8220.           underneath intact.   All of the sample  programs use an  array of
  8221.           20000 elements.   One character will  fit in each element  and an
  8222.           array of this  size will  allow us  to store  10 entire  screens.
  8223.           Most windows will be 
  8224.           significantly smaller than  an entire screen, so  20000 should be
  8225.           large enough  for almost all  applications.  It is  critical that
  8226.           the array is allocated dynamically.  This insures that QuickBasic
  8227.           will place  it  in the  far heap  and out  of  your current  data
  8228.           segment which is limited to 64K. 
  8229.            
  8230.                WINDOW FRAME 
  8231.            
  8232.           The window  frame is  a two-dimensional array  that allows  us to
  8233.           predefine window co-ordinates and assign a handle to them. 
  8234.            
  8235.                WINDOW POINTER 
  8236.  
  8237.  
  8238.           The  window  pointer maintains  the current  stack position.   It
  8239.           simply points to the next empty slot in the stack. 
  8240.            
  8241.            
  8242.  
  8243.                         Copyright (c) AJM Software 1987, 1991
  8244.                                 All Rights Reserved             Page 125
  8245.  
  8246.  
  8247.  
  8248.  
  8249.  
  8250.  
  8251.  
  8252.  
  8253.  
  8254.  
  8255.  
  8256.  
  8257.  
  8258.           The fields  mentioned above are  crucial to the operation  of the
  8259.           windowing system.   DO  NOT directly access  these fields.   They
  8260.           should be changed only by the windowing routines. 
  8261.            
  8262.           In general, you move around most of the windows using  the normal
  8263.           cursor control keys.  These are: 
  8264.            
  8265.                [RightArrow] 
  8266.                [LeftArrow] 
  8267.                [UpArrow] 
  8268.                [DownArrow] 
  8269.                [BackSpace] 
  8270.                [Home] 
  8271.                [End] 
  8272.                [Tab]      
  8273.                [PgUp] 
  8274.                [PgDn] 
  8275.                [Ins] (Data entry only) 
  8276.                [Del] (Data entry only) 
  8277.            
  8278.           Some of  these do not  apply to all  windowing or  menu routines.
  8279.           You  can get a feel  for them by running  the DEMO program or the
  8280.           sample programs and experimenting. 
  8281.            
  8282.            
  8283.           None of the routines contain extensive bounds or format  checking
  8284.           so passing  an empty array  or coordinates that don't  make sense
  8285.           (i.e.  row 40  and column  122) can and  will generally  cause an
  8286.           illegal function call or funny looking  display.  Overrunning the
  8287.           window stack will  generally cause your machine to lock  up.  You
  8288.           overrun the stack  when the space allocated is  not sufficient to
  8289.           hold all  of the windows  that have been  copied into  the stack.
  8290.           The routine PushWin puts a window into the stack and the  routine
  8291.           PopWin removes it from the stack and frees up the stack space. 
  8292.            
  8293.           If you have  any problems, look at the DEMO  and sample programs.
  8294.           Most  of the routines  are used there.   If you  still need help,
  8295.           feel free to call. 
  8296.  
  8297.  
  8298.  
  8299.  
  8300.  
  8301.  
  8302.  
  8303.  
  8304.  
  8305.  
  8306.  
  8307.  
  8308.  
  8309.                         Copyright (c) AJM Software 1987, 1991
  8310.                                 All Rights Reserved             Page 126
  8311.  
  8312.  
  8313.  
  8314.  
  8315.  
  8316.  
  8317.  
  8318.  
  8319.  
  8320.          ----------------end-of-author's-documentation---------------
  8321.  
  8322.                          Software Library Information:
  8323.  
  8324.                     This disk copy provided as a service of
  8325.  
  8326.                            Public (software) Library
  8327.  
  8328.          We are not the authors of this program, nor are we associated
  8329.          with the author in any way other than as a distributor of the
  8330.          program in accordance with the author's terms of distribution.
  8331.  
  8332.          Please direct shareware payments and specific questions about
  8333.          this program to the author of the program, whose name appears
  8334.          elsewhere in  this documentation. If you have trouble getting
  8335.          in touch with the author,  we will do whatever we can to help
  8336.          you with your questions. All programs have been tested and do
  8337.          run.  To report problems,  please use the form that is in the
  8338.          file PROBLEM.DOC on many of our disks or in other written for-
  8339.          mat with screen printouts, if possible.  PsL cannot debug pro-
  8340.          programs over the telephone, though we can answer questions.
  8341.  
  8342.          Disks in the PsL are updated  monthly,  so if you did not get
  8343.          this disk directly from the PsL, you should be aware that the
  8344.          files in this set may no longer be the current versions. Also,
  8345.          if you got this disk from another vendor and are having prob-
  8346.          lems,  be aware that  some files may have become corrupted or
  8347.          lost by that vendor. Get a current, working disk from PsL.
  8348.  
  8349.          For a copy of the latest monthly software library newsletter
  8350.          and a list of the 2,000+ disks in the library, call or write
  8351.  
  8352.                            Public (software) Library
  8353.                                P.O.Box 35705 - F
  8354.                             Houston, TX 77235-5705
  8355.  
  8356.                                 1-800-2424-PSL
  8357.                              MC/Visa/AmEx/Discover
  8358.  
  8359.                           Outside of U.S. or in Texas
  8360.                           or for general information,
  8361.                               Call 1-713-524-6394
  8362.  
  8363.                           PsL also has an outstanding
  8364.                           catalog for the Macintosh.
  8365.  
  8366.